有时候root需要远程连接,那么就要给mysql的root用户添加远程连接,前提已经安装好mysql。安装mysql教程:https://www.pzidc.com/news/content/899.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,测试
成功
Copyright © 2017-2021 Pzidc.com All Rights Reserved. 普泽云 版权所有 陕西云游四海网络科技有限公司 陕ICP备20002307号-4
《中华人民共和国增值电信业务经营许可证》B1-20182862