关于我们

质量为本、客户为根、勇于拼搏、务实创新

< 返回新闻公共列表

centos给mysql的root用户添加远程连接

发布时间:2019-09-27 10:58:48

 有时候root需要远程连接,那么就要给mysql的root用户添加远程连接,前提已经安装好mysql。安装mysql教程:https://www.56vps.cn/news/content/900.html
给root添加远程教程如下
1,添加3306系统防火强
/sbin/iptables -I INPUT -p tcp --dport 3306 -j ACCEPT
/etc/init.d/iptables save
/etc/init.d/iptables restart

2,添加远程,注意你的root密码,我这里的密码是123456
mysql -uroot -p123456
>use mysql;
>select host,user,password from user;
>create user 'root'@'%' identified by '123456';
>grant all on *.* to root@'%' identified by '123456';
>exit

3,测试

96.png

成功



/template/Home/Zkeys/PC/Static