centos 6.8启动mysql CentOS7和CentOS6怎样开启MySQL远程访问
1个回答
展开全部
关闭防火墙的情况下
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; #刷新才会生效
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; #刷新才会生效
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |