1

我有一个奇怪的问题。我在我的 ubuntu 9.04 上安装了 mysql 5.1。

我已经使用了很长时间(比如 3 个月),一切正常。直到我遇到这个非常奇怪的问题。

当我想连接到随机数据库时,我收到以下消息:

ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
Connection id:    1
Current database: test_cake

ERROR 2006 (HY000): MySQL server has gone away
No connection. Trying to reconnect...
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (111)
ERROR: 
Can't connect to the server

它只发生在某些数据库中,而其他数据库则完全有用且健康。之后,如果我尝试重新启动服务器,我会得到这个。

shell> /etc/init.d/mysql restart
 * Stopping MySQL database server mysqld                                        cat: /var/run/mysqld/mysqld.pid: Permiso denegado
                                                                         [fail]
 * Starting MySQL database server mysqld                                        cat: /var/run/mysqld/mysqld.pid: Permiso denegado
cat: /var/run/mysqld/mysqld.pid: Permiso denegado
cat: /var/run/mysqld/mysqld.pid: Permiso denegado
cat: /var/run/mysqld/mysqld.pid: Permiso denegado
cat: /var/run/mysqld/mysqld.pid: Permiso denegado
cat: /var/run/mysqld/mysqld.pid: Permiso denegado
cat: /var/run/mysqld/mysqld.pid: Permiso denegado
cat: /var/run/mysqld/mysqld.pid: Permiso denegado
cat: /var/run/mysqld/mysqld.pid: Permiso denegado
cat: /var/run/mysqld/mysqld.pid: Permiso denegado
cat: /var/run/mysqld/mysqld.pid: Permiso denegado
cat: /var/run/mysqld/mysqld.pid: Permiso denegado
cat: /var/run/mysqld/mysqld.pid: Permiso denegado
cat: /var/run/mysqld/mysqld.pid: Permiso denegado
cat: /var/run/mysqld/mysqld.pid: Permiso denegado
cat: /var/run/mysqld/mysqld.pid: Permiso denegado
                                                                         [fail]
("permiso denegado" is "permission denied").

我不知道该怎么办。我更改了 /var/run/mysqld/mysqld.pid 属性,但仍然无法正常工作。

有谁能够帮我 ?

4

1 回答 1

0

看看这是否可行:

su                   (become root)
su mysql             (become user mysql, or whatever account mysql runs as)
cd /var/run/mysqld   (see if the directory is accessible to mysql)
cat mysqld.pid       (see if the file is accessible)
于 2009-11-17T23:57:09.717 回答