文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>解决远程连接MySQL

解决远程连接MySQL

时间:2007-06-22  来源:rac911

环境: Server1:MYSQL1+AS4 Server2:MYSQL2+AS4 目的: 从Server1连接到Server2上的MYSQL TNND,尝试了N遍.远程老是连接不上MYSQL,爆错如下: [root@etc mysql]# mysql -ueagle -p
Enter password:
ERROR 1045 (28000): Access denied for user 'eagle'@'localhost' (using password: YES)
找一篇文章看一下,豁然开朗,并很快解决问题.步骤如下: Server1上配置: [root@etc etc]# mysql -uroot -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 58
Server version: 5.0.41-community MySQL Community Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> use mysql;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select host,user,password from user;
+---------------+-------+-------------------------------------------+
| host          | user  | password                                  |
+---------------+-------+-------------------------------------------+
| localhost     | root  | *E74858DB86EBA20BC33D0AECAE8A8108C56B17FA |
| etc           | root  |                                           |
| 127.0.0.1     | root  |                                           |
| 192.168.1.162 | eagle | *A405AB5000F1FB26DD3D3EB259A6E424169B2AEB |
| %             | root  | *D4CECBA84F0A507325CD8AA82FCDE04EA8BE56B0 |
+---------------+-------+-------------------------------------------+
5 rows in set (0.00 sec)
mysql> grant select,update,insert,delete on *.* to [email protected] identified by "eagle";
Query OK, 0 rows affected (0.01 sec)
mysql> select host,user,password from user;
+---------------+-------+-------------------------------------------+
| host          | user  | password                                  |
+---------------+-------+-------------------------------------------+
| localhost     | root  | *E74858DB86EBA20BC33D0AECAE8A8108C56B17FA |
| etc           | root  |                                           |
| 127.0.0.1     | root  |                                           |
| 192.168.1.162 | eagle | *A405AB5000F1FB26DD3D3EB259A6E424169B2AEB |
| %             | root  | *D4CECBA84F0A507325CD8AA82FCDE04EA8BE56B0 |
| 192.168.1.161 | eagle | *A405AB5000F1FB26DD3D3EB259A6E424169B2AEB |
+---------------+-------+-------------------------------------------+
6 rows in set (0.00 sec)
mysql>   Server2上测试: [root@rman mysql]# mysql -h 192.168.1.162 -ueagle -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 60
Server version: 5.0.41-community MySQL Community Edition (GPL)
Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql>   OK,问题解决!加油,MySQL菜菜鸟快入门了,,,    
相关阅读 更多 +
排行榜 更多 +
找茬脑洞的世界安卓版

找茬脑洞的世界安卓版

休闲益智 下载
滑板英雄跑酷2手游

滑板英雄跑酷2手游

休闲益智 下载
披萨对对看下载

披萨对对看下载

休闲益智 下载