1

I've tried finding the solution to my error on multiple website, as well as other questions on serverfault. None have fixed this error for me.

MySQL was working just fine up until I added the following to my.cnf:

[client]
socket=/var/lib/mysql/mysql.sock

Once I restarted MySQL I received the error:

MySQL Daemon failed to start.
Starting mysqld:                                           [FAILED]

I tried removing what I had added to my.cnf and tried starting MySQL but it still refused to start. I checked to see if mysql.sock was in /var/lib/mysql/ but it wasn't. I tried adding a blank mysql.sock file, chowning it mysql, and chmoding it to 4777. It still wouldn't start.

I also have tried removing and updating mysql and mysql-server, neither of which worked. Nothing seems to be working so I came here to see if you guys had any other suggestions that might help.

Yes the problem is clearly that mysql.sock doesn't exist, but how should I add it properly or is there a way to have MySQL create it?

Below are my log files of attempting to start MySQL along with my my.cnf configuration file:

110608 16:07:05 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
110608 16:07:05 [ERROR] Error message file '/usr/share/mysql/english/errmsg.sys' had only 480 error messages,
but it should contain at least 709 error messages.
Check that the above file is the right version for this program!
110608 16:07:05 [Note] Plugin 'FEDERATED' is disabled.
/usr/libexec/mysqld: Unknown error 1146
110608 16:07:05 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
110608 16:07:05 InnoDB: The InnoDB memory heap is disabled
110608 16:07:05 InnoDB: Mutexes and rw_locks use GCC atomic builtins
110608 16:07:05 InnoDB: Compressed tables use zlib 1.2.3
110608 16:07:05 InnoDB: Using Linux native AIO
110608 16:07:05 InnoDB: Initializing buffer pool, size = 128.0M
110608 16:07:05 InnoDB: Completed initialization of buffer pool
110608 16:07:05 InnoDB: highest supported file format is Barracuda.
110608 16:07:05  InnoDB: Waiting for the background threads to start
110608 16:07:06 InnoDB: 1.1.7 started; log sequence number 1595675
110608 16:07:06 [ERROR] Aborting

110608 16:07:06  InnoDB: Starting shutdown...
110608 16:07:07  InnoDB: Shutdown completed; log sequence number 1595675
110608 16:07:07 [Note]
110608 16:07:07 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

mysql_upgrade:

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

my.cnf:

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1

# Disabling symbolic-links is recommended to prevent assorted security risks;
# to do so, uncomment this line:
# symbolic-links=0

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

[client]
socket=/var/lib/mysql/mysql.sock

Thanks.

6
  • [1] What OS (Linux version)? [2] MySQL version? [3] Is "/var/lib/mysql/" owned by the user who is allowed to run mysql?
    – Henk
    Jun 8, 2011 at 20:59
  • [1] CentOS release 5.6 [2] 5.0.77 [3] It's owned by mysql
    – Jon
    Jun 8, 2011 at 21:03
  • FYI Don't create "mysql.sock" by hand! Remove the file if it's there. The MySQL daemon will create (and remove) this file upon starting (and stopping).
    – Henk
    Jun 8, 2011 at 21:11
  • Removed it and followed the steps below, it still is unable to start.
    – Jon
    Jun 8, 2011 at 22:02
  • Have you considered simply reinstalling MySQL? Jun 9, 2011 at 8:17

4 Answers 4

1

The first error is "[ERROR] Error message file '/usr/share/mysql/english/errmsg.sys'", you should work on it. Try to read this post.

1
  • Ig. is right. You are focusing a lot on mysql.sock, but that line you added is in the client section - mysqld does not read that section. Please read this here: dev.mysql.com/doc/refman/5.0/en/option-files.html "The [client] option group is read by all client programs (but not by mysqld)." Fix the error with errmsg.sys.
    – Rilindo
    Sep 14, 2011 at 3:54
0

As root, remove the file /var/lib/mysql/mysql.sock and run these commands:

chown mysql:mysql /var/lib/mysql
chmod 700 /var/lib/mysql
chkconfig --level 345 mysql on
service mysqld start
1
  • Still is failing to start. And I assume that you meant 'chkconfig --level 345 mysqld on'?
    – Jon
    Jun 8, 2011 at 22:01
0

After reading all the tips from others: are you absolutely sure that the client socket addition was the only change between MySQL restarts?

I've had my share of "Hey guys, this was the only change I did, I swear" situations as well; after a bit of pondering I then find out something like "Oops. I had upgraded distro packages one week ago and forgot to restart MySQL after that" or "I just make this tiny little change to this other config file". And then when I try to restart some service, it doesn't start and only a fair share of debugging helps...

What if you comment out the socket lines away from my.cnf, does that help?

Also, is SELinux enabled? Try setenforce 0 if it is.

1
  • SELinux is very likely here, particularly if you're now trying to set up the mysql socket on a different filesystem than the mysql executable. Do you especially care where the socket is kept? Jun 10, 2011 at 17:25
0

sounds like you upgrade from pre 5.5 to 5.5..

You have to start mysql with --skip-grant-tables then run

mysql_upgrade

Now for the errmsg.sys find it in your compiled or installed location and move it to

/usr/share/mysql/english/errmsg.sys

You must log in to answer this question.

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