服务报价 | 域名主机 | 网络营销 | 软件工具| [加入收藏]
 热线电话: #
当前位置: 主页 > 开发教程 > linux教程 >

centos7安装mariadb的方法介绍

时间:2016-09-29 21:21来源:未知 作者:最模板编辑 点击:
1.配置数据库yum源 [root@web-001 ~]# cat /etc/yum.repos.d/MariaDB.repo # MariaDB 10.1 CentOS repository list - created 2016-05-12 09:28 UTC # http://mariadb.org/mariadb/repositories/ [mariadb] name = MariaDB baseurl = http://yum.mariad
 
1.配置数据库yum源
 
[root@web-001 ~]# cat /etc/yum.repos.d/MariaDB.repo 
# MariaDB 10.1 CentOS repository list - created 2016-05-12 09:28 UTC
# http://mariadb.org/mariadb/repositories/
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1
 
 
至MariaDB.repo文件,保存文件并退出
 
安装数据库:
 
yum install MariaDB-server MariaDB-client -y
2.Mariadb服务
 
启动服务:
 
systemctl start mariadb.service
停止服务:
 
systemctl stop mariadb.service
重启服务:
 
systemctl restart mariadb.service
查看状态
 
systemctl status mariadb.service
3.生产服务器需要执行mysql_secure_installation
 
[root@web-001 ~]# /usr/bin/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] n //是否设置root密码
 ... skipping.
 
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!
(责任编辑:最模板)
顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
栏目列表
热点内容