Mysql奇怪的连接问题

发布于 2024-08-12 00:23:19 字数 1931 浏览 1 评论 0原文

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

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

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

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 属性但仍然无法正常工作。

有人可以帮助我吗?

I've a weird problem. I've mysql 5.1 installed on my ubuntu 9.04.

I've used it a long time (say 3 month) and everything was going right. Until i faced this really weird problem.

When i want to connect to a random database i get this message:

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

It only happens with some databases, while others are totally usefull and healthy. After that, if i try to restart the server i get this.

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").

I don't know what to do. I change the /var/run/mysqld/mysqld.pid attributes but still not working.

Can anybody help me ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

审判长 2024-08-19 00:23:19

看看这是否有效:

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)

See if this will work:

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)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文