CentOS 7.2使用yum安装MariaDB10.1
CentOS 7.2使用yum安装MariaDB10.1
①添加MariaDB的yum源
1.创建MariaDB.repo
sudo vi /etc/yum.repos.d/Mariadb.repo
2.将以下文件中的字段添加到MariaDB.repo文件中
# MariaDB 10.1 CentOS repository list - created 2016-12-01 03:36 UTC # http://downloads.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
②yum安装MariaDB
sudo yum -y install MariaDB-server MariaDB-client
③启动MariaDB服务
systemctl start mysql.service
④配置MariaDB服务
使用mysql_secure_installation配置MariaDB服务
mysql_secure_installation
具体设置
#由于一开始安装MariaDB数据库后, root用户默认密码为空, 所以只需要按Enter键 Enter current password for root (enter for none): #是否设置root用户的新密码 Set root password? [Y/n] y #录入新密码 New password: #确认新密码 Re-enter new password: #是否删除匿名用户,生产环境建议删除 Remove anonymous users? [Y/n] y #是否禁止root远程登录,根据自己的需求选择 Disallow root login remotely? [Y/n] n #是否删除test数据库 Remove test database and access to it? [Y/n] y #是否重新加载权限表 Reload privilege tables now? [Y/n] y
⑤开启远程访问
1.防火墙添加3306端口
查看firewall状态
firewall-cmd --state
状态是not running,启动firewall
systemctl start firewalld
状态是running
开放3306端口
firewall-cmd --zone=public --add-port=3306/tcp --permanent
重新载入
firewall-cmd --reload
2.明明之前有设置root开启远程的,但是我这里访问不了,所以重新去MariaDB赋权限
MariaDB 的详细介绍:请点这里
MariaDB 的下载地址:请点这里
相关推荐
Lostinthewoods 2020-10-29
Gexrior 2020-10-22
txt 2020-06-14
azhou 2020-06-12
hungzz 2020-06-11
CharlesYooSky 2020-06-05
aliuge 2020-06-03
URML 2020-05-30
lwwishes 2020-05-29
83173052 2020-05-29
tanyhuan 2020-05-28
muzirigel 2020-05-26
饮马天涯 2020-05-20
aliuge 2020-05-12
83173052 2020-05-10
Mrbianxin 2020-05-07
InJavaWeTrust 2020-05-04