CentOS7.4安装mariadb10.1.28

官方安装说明

添加源

vi /etc/yum.repos.d/MariaDB.repo
[mariadb]
name = MariaDB
baseurl = http://yum.mariadb.org/10.1/centos7-amd64
gpgkey=https://yum.mariadb.org/RPM-GPG-KEY-MariaDB
gpgcheck=1

安装

yum install MariaDB-server

防火墙设置

firewall-cmd --zone=public --permanent --add-service=mysql
firewall-cmd --reload

启动

systemctl start mariadb

开机自启动

systemctl enable mariadb

安全设置

mysql_secure_installation
//初始安装root是空密码,直接回车
Enter current password for root (enter for none): 
//设置新密码
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] Y
//删除test数据库
Remove test database and access to it? [Y/n] Y
//重新加载权限表
Reload privilege tables now? [Y/n] Y

为安全root仅限本地登录,根据需要可以新建一个有管理员权限的远程用户

mysql -uroot -p
GRANT ALL PRIVILEGES ON *.* TO '用户名'@'%' IDENTIFIED BY '登录密码' WITH GRANT OPTION;
FLUSH PRIVILEGES;
exit;

相关文章

linux下开机自启: 在/etc/init.d目录下新建文件elasticsear...
1、因为在centos7中/etc/rc.d/rc.local的权限被降低了,所以...
最简单的查看方法可以使用ls -ll、ls-lh命令进行查看,当使用...
ASP.NET Core应用程序发布linux在shell中运行是正常的。可一...
设置时区(CentOS 7) 先执行命令timedatectl status|grep &...
vim /etc/sysconfig/network-scripts/ifcfg-eth0 B...