Chaotic lines | 设置MySQL远程链接
This site is a portfolio of Ray . Hope you enjoy it!
故事板,分镜头,storyboard,电影分镜,分镜师,storyboard artist
4647
post-template-default,single,single-post,postid-4647,single-format-standard,ajax_updown_fade,page_not_loaded,,qode-child-theme-ver-1.0.0,qode-theme-ver-3.6,wpb-js-composer js-comp-ver-5.4.2,vc_responsive
 

Blog

设置MySQL远程链接

  |   Geek   |   No comment


//更改mysql自身数据库‘mysql’
use mysql;
select host,user,password from user;

//%允许任何主机连接本数据库,
grant all privileges on *.* to 'root'@'%' identified by 'XXXXXXXXX' with grant option;

//重置mysql服务;
flush privileges;

//退出mysql
exit;

//如果有防火墙,确保打开3306端口
iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT

//开关防火墙(重启)
chkconfig iptables on
chkconfig iptables off

//临时开关防火墙
service iptables start
service iptables stop

//连接方命令:
mysql -u root -p -h 地址

No Comments

Post A Comment