免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1163 | 回复: 0
打印 上一主题 下一主题

解决远程连接MySQL [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2007-06-22 15:17 |只看该作者 |倒序浏览
环境:
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
[email='eagle'@'localhost']'eagle'@'localhost'[/email]
(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
eagle@192.168.1.161
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菜菜鸟快入门了,,,



本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/26381/showart_326466.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP