0

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 ?

1 Answer 1

0

do u have other instance of mysql on the same server ? Mysqld is run as what user ? who is the owner of /var/run/mysqld/mysqld.pid ?

-- Regards, Robert

2
  • Hi Robert, thanks for your answer. I've just one instance of mysql running on my PC. It's a Ubuntu 9.04. The owner is "root" and the owner of /var/run/mysqld/mysqld.pid is "mysql" I'll print the ls -l output for you: santiago@santiago-desktop:~$ ls -la /var/run/mysqld/ drwxr-xr-x 2 mysql root 80 2009-11-18 11:26 . drwxr-xr-x 19 root root 940 2009-11-18 14:40 .. -rw-rw---- 1 mysql mysql 5 2009-11-18 11:26 mysqld.pid srwxrwxrwx 1 mysql mysql 0 2009-11-18 11:26 mysqld.sock Nov 18, 2009 at 17:47
  • 1
    hello sorry for a huge postpone :D. If this issue is still valid please add at the beginning of /etc/init.d/mysql (mysql start-up script) "#!/bin/bash -x " as a replacement for "#!/bin/bash" I think that line "if [ -f "$pidfile" ] && ps cat $pidfile >/dev/null 2>&1; then ps_alive=1; fi" produce errors. -x is a debug option for bash it will show you what the script is actually doing and it will give some clue where the problem is. -- Regards, Robert
    – Robert
    Nov 29, 2009 at 17:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .