连接远程mysql数据库

1、确保远程数据库可被访问

远程到电脑或者直接在远程主机上 用root登录

执行 grant all privileges on *.* to “root”@“%” identified by “xxx” with grant option;

注:xxx为登录密码

2、远程连接

mysql -h xxx -u root -p;

注:xxx为远程ip

猜你喜欢

转载自blog.csdn.net/su513292239/article/details/50903474