??斗地主捕鱼电竞提现秒到 广告位招租 - 15元/月全站展示
??支付宝搜索579087183领大额红包 ??伍彩集团官网直营彩票
??好待遇→招代理 ??伍彩集团官网直营彩票
??络茄网 广告位招租 - 15元/月全站展示
CentOS7系统下安装MariaDB的步骤教程

转载   2018-04-18   浏览量:493


上海天彩集团:1安装 MariaDB

彩票开奖查询 www.kbyp.net 通过 Yum 安装 MariaDB:

sudo yum install mariadb-server

安装完成后通过下面的命令启动 MariaDB:

sudo systemctl start mariadb

如果想查看服务状态,可以使用下面命令:

sudo systemctl status mariadb

如果 MariaDB 启动成功,状态中会包括“Active: active (running)”,最后一句话一般是:

Apr 17 14:32:54 VM_157_18_centos systemd[1]: Started MariaDB database server.

如果需要每次服务器重启时都自动启动数据库,可以通过下面命令实现(创建符号链接):

sudo systemctl enable mariadb

上面命令的输出跟下面一样时,表示成功执行:

Created symlink from /etc/systemd/system/multi-user.target.wants/mariadb.service to /usr/lib/systemd/system/mariadb.service.

安装完成后,有一系列命令可以使用:

mysql                       mysqld_safe_helper          mysql_secure_installation
mysqlaccess                 mysqldump                   mysql_setpermission
mysqladmin                  mysqldumpslow               mysqlshow
mysqlbinlog                 mysql_find_rows             mysqlslap
mysqlbug                    mysql_fix_extensions        mysqltest
mysqlcheck                  mysqlhotcopy                mysql_tzinfo_to_sql
mysql_convert_table_format  mysqlimport                 mysql_upgrade
mysqld_multi                mysql_install_db            mysql_waitpid
mysqld_safe                 mysql_plugin                mysql_zap

2. 对 MariaDB 服务器进行安全设置

MariaDB 包含一个安全脚本,可以改变一些不安全的默认行为,比如远程登录、简单用户设置等。运行安全脚本:

sudo mysql_secure_installation

脚本的每一步都会有详细的解释。第一个交互部分需要你提供 root 密码,因为刚安装的 MariaDB 还没有设置密码,这里直接按 ENTER 进入下一步。下一步设置 root 用户密码。后面的可以全部输入 Y 使用 MariaDB 的建议操作。完整命令如下

# mysql_secure_installation 

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none): 
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

3. 测试

用 mysqladmin 执行命令,查看数据库版本:

mysqladmin -u root -p version

输出类似下面:

mysqladmin  Ver 9.0 Distrib 5.5.56-MariaDB, for Linux on x86_64
Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Server version      5.5.56-MariaDB
Protocol version    10
Connection      Localhost via UNIX socket
UNIX socket     /var/lib/mysql/mysql.sock
Uptime:         14 min 59 sec

Threads: 1  Questions: 25  Slow queries: 0  Opens: 1  Flush tables: 2  Open tables: 27  Queries per second avg: 0.027

登录数据库

以 root 身份登录后,可以执行任何操作:

mysql -u root -p

转载自:https://www.2cto.com/database/201804/738292.html

招聘 不方便扫码就复制添加关注:程序员招聘谷,微信号:jobs1024



CentOS7系统下安装MariaDB的步骤教程
CentOS7系统下安装MariaDB的步骤教程。1安装MariaDB:通过Yum安装MariaDB:
MariaDB的安装和配置教程
MariaDB的安装和配置教程。1环境:centos74。2安装:使用系统自带的yum安装,命令如下:
MariaDB停止、启动、设置开机启动,查看设置连接数的方法
MariaDB停止、启动、设置开机启动,查看设置连接数的方法。查看当前连接数:
Linux下载并安装mariaDB数据库的步骤教程
Linux下载并安装mariaDB数据库的步骤教程。1下载mariadb:可以去官网下。2可以在本地下载完成之后直接解压,将解压后的目录的svrmariadb-10020-linux-x86_64直接通过ftp上传到Linux服务器,这里我是上传到服务器opt目录下,并更名为mariadb
centos7 Mariadb创建多实例数据库步骤教程
centos7Mariadb创建多实例数据库步骤教程。为了对mycat做实验,于是创建多实例Mariadb,做以下笔记:
centos7系统安装Mariadb
从最新版本的centos系统开始,使用命令yuminstallmysql默认安装的是Mariadb而不是mysql!
linux下安装MariaDB
MariaDB数据库分为源代码版本和二进制版本,源代码版本需要cmake编译,这里是二进制版本的安装。
mariadb主从复制
mariadb主从复制:1、主从服务器分别作以下操作;2、修改主服务器master:3、修改从服务器slave:
安装mariadb数据库=centos7自学之四
安装mariadb数据库=centos7自学之四:一)全部删除系统自带的MySQLMariaDB;二)添加MariaDB的yum源
mariadb克隆
oracle有克隆安装,其实mysqlmariadb类似,只需简单几步就可以直接在异机直接启动环境:node01安装完成的mariadb;node02一个新机器现在将node01克隆到node02机器--1node02准备环境yumremovemysql