标签:火墙 ble 生效 SQ sql 注意 table use password
1.修改默认端口
打开配置文件
vim /etc/my.cnf
分别添加端口在client、mysql节点
[client] port=15099 [mysqld] port=15099
需要注意selinux会影响这个设置生效,因此需要先关闭
setenforce 0
如需外部访问,还需注意防火墙添加端口
2.添加新帐号
# 只限本地访问 CREATE USER ‘username‘@‘localhost‘ IDENTIFIED BY ‘password‘; # 外网不限IP地址 CREATE USER ‘username‘@‘%‘ IDENTIFIED BY ‘password‘; #外网指定IP地址 CREATE USER ‘username‘@‘192.168.1.20‘ IDENTIFIED BY ‘password‘;
3.授权账号
# 指定权限与库表名给指定用户指定地址访问 grant select,update,insert,delete on databasename.tablename to username@‘%‘ identified by ‘password‘; # 指定全部权限 全部表给 全部访问路径的指定用户 grant all privileges on *.* to ‘root‘@‘localhost‘ identified by ‘password‘;
4.生效权限
flush privileges;
标签:火墙 ble 生效 SQ sql 注意 table use password
原文地址:https://www.cnblogs.com/liuyi2614/p/8918820.html