centos 6.8启动mysql CentOS7和CentOS6怎样开启MySQL远程访问

2020-06-15 教育 185阅读
关闭防火墙的情况下
sudo vim /etc/sysconfig/iptables
-A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT
sudo service iptables restart
mysql > use mysql;
#创建openscanner用户与密码并设置为从安装mysql服务的机器本地访问
mysql > grant all on openscannerstore.* to 'openscanner'@'localhost'
identified by 'scanner888';
#设置openscanner用户与密码,并从任何机器都可以访问mysql
mysql > grant all on openscannerstore.* to 'openscanner'@'%' identified by 'scanner888';
mysql > flush privileges; #刷新才会生效
声明:你问我答网所有作品(图文、音视频)均由用户自行上传分享,仅供网友学习交流。若您的权利被侵害,请联系fangmu6661024@163.com