发新话题 提问用悬赏,解答更迅速
打印

[Linux相关] 【小技巧】解决mysql远程连接的问题

【小技巧】解决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账号就可以远程连接了。不过这是个很危险的行为
拈朵微笑的花,看一番人世繁华

TOP

是啊!顶!!!

TOP

‹‹ 上一帖:linux 集群在虚拟机上   |   下一帖:【Linux进阶】Web服务器的安装(整合JSP+PHP) ... ››
发新话题 提问用悬赏,解答更迅速
最近访问的版块