将权限改为ALL PRIVILEGES
MySQL> use MySQL;
Database changed
MySQL> grant all privileges on *.* to root@'%' identified by "root";
Query OK, 0 rows affected (0.00 sec)
MySQL> select host,user,password from user;
+--------------+------+-------------------------------------------+
| host | user | password |
+--------------+------+-------------------------------------------+
| localhost | root | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| 192.168.1.12 | root | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| % | root | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
+--------------+------+-------------------------------------------+
3 rows in set (0.00 sec)
这样机器就可以以用户名root密码root远程访问该机器上的MySQL.
3、实现MySQL远程连接(改表法)
use MySQL;
update user set host = '%' where user = 'root';
这样在远端就可以通过root用户访问MySQL.
原载于:
全文:
阅读(1922) | 评论(0) | 转发(0) |