使用MySQL:
mysql> use mysql; Database changed
查看用户只有localhost
mysql> select user,host from user; +-----------+-----------+ | user | host | +-----------+-----------+ | my | localhost | | root | localhost | +-----------+-----------+ 2 rows in set sec)
设置远程访问
mysql> update user set host='%' where user='root'; Query OK, 1 row affected sec) Rows matched: 1 Changed: 1 Warnings: 0
刷新即可
mysql> flush privileges; Query OK, 0 rows affected sec)
【MySQL】Mysql数据库如何开启远程访问。