mysql: job failded to start. mysqld.sock is missing

Posted by Freefri on Server Fault See other posts from Server Fault or by Freefri
Published on 2012-11-23T10:48:07Z Indexed on 2012/11/23 11:02 UTC
Read the original article Hit count: 390

Filed under:

How can I fix this and start mysql-server?

After /etc/init.d/mysql start or service mysql start I get the message start: "Job failed to start" And after # mysqld I get this:

mysqld
121123 11:33:33 [ERROR] Can't find messagefile '/usr/share/mysql/errmsg.sys'
121123 11:33:33 [Note] Plugin 'FEDERATED' is disabled.
mysqld: Unknown error 1146
121123 11:33:33 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
121123 11:33:33 InnoDB: The InnoDB memory heap is disabled
121123 11:33:33 InnoDB: Mutexes and rw_locks use GCC atomic builtins
121123 11:33:33 InnoDB: Compressed tables use zlib 1.2.3.4
121123 11:33:33 InnoDB: Initializing buffer pool, size = 128.0M
121123 11:33:33 InnoDB: Completed initialization of buffer pool
121123 11:33:33 InnoDB: highest supported file format is Barracuda.
121123 11:33:33  InnoDB: Waiting for the background threads to start
121123 11:33:34 InnoDB: 1.1.8 started; log sequence number 1595675
121123 11:33:34 [ERROR] Aborting
121123 11:33:34  InnoDB: Starting shutdown...
121123 11:33:35  InnoDB: Shutdown completed; log sequence number 1595675
121123 11:33:35 [Note]

I try to do what mysql say me to do:

mysql_upgrade
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/run/mysqld/mysqld.sock' 
mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect
FATAL ERROR: Upgrade failed

And yes, /var/run/mysql is empty:

mysql_upgrade
Looking for 'mysql' as: mysql
Looking for 'mysqlcheck' as: mysqlcheck
Running 'mysqlcheck' with connection arguments: '--port=3306' '--socket=/var/run/mysqld/mysqld.sock' 
mysqlcheck: Got error: 2002: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) when trying to connect
FATAL ERROR: Upgrade failed

And this is my file /etc/mysql/my.cnf

# cat /etc/mysql/my.cnf |grep sock
# Remember to edit /etc/mysql/debian.cnf when changing the socket location.
socket      = /var/run/mysqld/mysqld.sock
socket      = /var/run/mysqld/mysqld.sock
socket      = /var/run/mysqld/mysqld.sock

Then I try to reinstall mysql from cero:

  apt-get purge mysql-client mysql-common mysql-server
  rm -R /var/lib/mysql
  rm -R /etc/mysql
  rm -R /var/run/mysqld
  userdel mysql
  apt-get install mysql-server mysql-client

Then, after typing my root password for mysql I get this error:

 | Unable to set password for the MySQL "root" user                              ¦  
 ¦                                                                               ¦  
 ¦ An error occurred while setting the password for the MySQL administrative     ¦  
 ¦ user. This may have happened because the account already has a password, or   ¦  
 ¦ because of a communication problem with the MySQL server.                     ¦  
 ¦                                                                               ¦  
 ¦ You should check the account's password after the package installation.       ¦  
 ¦                                                                               ¦  
 ¦ Please read the /usr/share/doc/mysql-server-5.5/README.Debian file for more   ¦  
 ¦ information.

And again I can't start mysql getting the same messages.

© Server Fault or respective owner

Related posts about mysql