mysql 添加用户权限配置
#查看mysql用户
select user,host from user;
#删除匿名用户
Delete FROM user Where user='' and host='localhost.localdomain';
Delete FROM user Where user='' and host='localhost';
#添加mysql用户
create user 'rhdb'@'%' identified by '123456';
#添加mysql权限
grant all privileges on *.* to 'rhdb'@'%' identified by '123456';
#刷新mysql权限
flush privileges;
#mysql开机自启动
systemctl enable mariadb.service
#重启mysql
systemctl restart mariadb.service
systemctl stop mariadb.service
systemctl start mariadb.service
#打开mysql 3306
sudo firewall-cmd --zone=public --add-port=3306/tcp --permanent
#防火墙操作
systemctl stop firewalld.service
systemctl start firewalld.service