- 下载mariadb:yum -y install mariadb-server mariadb
- 开启mariadb服务:systemctl start mariadb
- 无密码登录mariadb:mysql
- 查看用户表:select * from mysql.user\G
- 添加远程访问用户:grant all on . to 'root'@'%' identified by '123456'
- 设置添加用户的授权权限:update mysql.user set Grant_priv='Y' where Host='%'
- 移除匿名用户:delete from mysql.user where Host<>'%' or User<>'root'
- 重启mariadb:systemctl restart mariadb
本文转自 Lee_吉 51CTO博客,原文链接:http://blog.51cto.com/12173069/2047746