【小技巧】解决mysql远程连接的问题
虽然mysql默认是不允许远程连接的,但是某些时候调试必须用到远程连接,我们可以采取如下的办法解决。
mysql -u root -p
Enter password: ********
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 5.0.9-beta
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql>
解决方法:
mysql>grant all on *.* to root@'%' identified by 'yourpassword';
mysql>flush privileges;
这样root账号就可以远程连接了。不过这是个很危险的行为
搜索更多相关主题的帖子:
mysql 技巧 解决