有时候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,测试
成功
Copyright © 2013-2023 . All Rights Reserved. 宵云 版权所有 南通宵云网络科技有限公司
工信部备案:苏ICP备18049042号-2 公安部备案:苏公网安备 32060102320703号
《中华人民共和国增值电信业务经营许可证》经营性ICP/ISP/IDC三证:苏B1.B2-20210805