+ -
当前位置:首页 → 问答吧 → MySQL连接的问题,请问是否和2005安全设置有关?

MySQL连接的问题,请问是否和2005安全设置有关?

时间:2005-05-16

来源:互联网

装完mysql启动之后,远程连接的时候总是说:
MySQL Error Number 2003
Can't connect to MySQL server on 'xx.xx.xx.xx'(10061)

直接在服务器端输入mysql -h 127.0.0.1也不能连接:
[root@ADWAYS-55 ~]# mysql -h 127.0.0.1
ERROR 2003 (HY000): Can't connect to MySQL server on '127.0.0.1' (111)

但是直接输入mysql是可以的:
[root@ADWAYS-55 ~]# mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3 to server version: 4.1.11

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> quit
Bye

google出来一个类似的结果,是说由于debian本身的安全策略导致的。
而我是刚刚安装了Mandriva LE 2005,请问是不是这个原因呢?

作者: 维扬剑客   发布时间: 2005-05-16

是自己编译安装的?
看看是不是把tcp/ip连接给屏蔽了?

作者: bbefadmin   发布时间: 2005-05-16

找到解决办法了:
http://www.linuxsir.org/bbs/showthread.php?t=198838

http://forums.mysql.com/read.php?11,...5577#msg-25577
---------------------------------------------------------------------------------
Solved ! on Mandriva 10.2, use urpmi instead of graphical install :
----------------------------------------------------------------------
More information on package MySQL-4.1.11-1mdk.x86_64
As a security measure networking in the mysql server has been disabled per
default, only localhost connections will work. This is because the mysql
root user has no password in a default install and that leaves the MySQL
server open for anyone to use.

To enable networking the user has to edit or delete the
/etc/sysconfig/mysqld file.
----------------------------------------------------------------------

把/etc/sysconfig/mysqld改名为/etc/sysconfig/mysqld.bak就好了

作者: 维扬剑客   发布时间: 2005-05-16

引用:
作者: bbefadmin
是自己编译安装的?
看看是不是把tcp/ip连接给屏蔽了?
我也试着重新编译安装了一下,不过还是有这个问题。
Thanks anyway!

作者: 维扬剑客   发布时间: 2005-05-16

唉~我总算找到了。
这个文档在
/usr/share/doc/MySQL-4.1.11/README.urpmi
如果是通过 drakconf 安装的话,安装后会有信息提示的。

作者: islue   发布时间: 2005-05-16

嗯,不错,urpmi安装后是有提示的!

作者: yankaiqian   发布时间: 2005-05-26