LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   MySQL Daemon failed to start. (https://www.linuxquestions.org/questions/linux-software-2/mysql-daemon-failed-to-start-845353/)

zushiba 11-19-2010 11:59 AM

MySQL Daemon failed to start.
 
I'm really not sure what I'm doing wrong. I'm attempting to start mysql

Code:

[root@bebop-test /]#  /etc/init.d/mysqld restart
Stopping mysqld:                                          [  OK  ]
MySQL Daemon failed to start.
Starting mysqld:                                          [FAILED]

running mysql returns.
Code:

[root@bebop-test /]# mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

Googled the problem and every article I could find says basically, find your mysql.sock file and set your my.cnf file to the proper location.

I search for the file and it does not appear to exist anywhere, not in /tmp or /var/lib/mysql/ or anywhere else find could look.

Google says, possibly mysqld doesn't have permissions to create the mysql.dock file, but the folder appears to be set with proper permissions.

My my.cnf
Code:

[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


And my error log
Code:

101119 09:05:33  mysqld ended

101119 09:12:12 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
101119  9:12:12 [ERROR] Error message file '/usr/share/mysql/english/errmsg.sys' had only 480 error messages,
but it should contain at least 705 error messages.
Check that the above file is the right version for this program!
/usr/libexec/mysqld: Unknown error 1146
101119  9:12:12 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Compressed tables use zlib 1.2.3
101119  9:12:12  InnoDB: Using Linux native AIO
101119  9:12:12  InnoDB: Initializing buffer pool, size = 128.0M
101119  9:12:12  InnoDB: Completed initialization of buffer pool
101119  9:12:12  InnoDB: highest supported file format is Barracuda.
InnoDB: 127 rollback segment(s) active.
101119  9:12:12  InnoDB: 1.1.3 started; log sequence number 86683
101119  9:12:12 [ERROR] Aborting

101119  9:12:12  InnoDB: Starting shutdown...
101119  9:12:18  InnoDB: Shutdown completed; log sequence number 1650993
101119  9:12:18 [Note]
101119 09:12:18 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
101119 09:18:21 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
101119  9:18:21 [ERROR] Error message file '/usr/share/mysql/english/errmsg.sys' had only 480 error messages,
but it should contain at least 705 error messages.
Check that the above file is the right version for this program!
/usr/libexec/mysqld: Unknown error 1146
101119  9:18:21 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Compressed tables use zlib 1.2.3
101119  9:18:21  InnoDB: Using Linux native AIO
101119  9:18:21  InnoDB: Initializing buffer pool, size = 128.0M
101119  9:18:21  InnoDB: Completed initialization of buffer pool
101119  9:18:21  InnoDB: highest supported file format is Barracuda.
101119  9:18:21  InnoDB: 1.1.3 started; log sequence number 1650993
101119  9:18:21 [ERROR] Aborting

101119  9:18:21  InnoDB: Starting shutdown...
101119  9:18:27  InnoDB: Shutdown completed; log sequence number 1650993
101119  9:18:27 [Note]
101119 09:18:27 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
101119 09:30:41 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
101119  9:30:41 [ERROR] Error message file '/usr/share/mysql/english/errmsg.sys' had only 480 error messages,
but it should contain at least 705 error messages.
Check that the above file is the right version for this program!
/usr/libexec/mysqld: Unknown error 1146
101119  9:30:41 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Compressed tables use zlib 1.2.3
101119  9:30:41  InnoDB: Using Linux native AIO
101119  9:30:41  InnoDB: Initializing buffer pool, size = 128.0M
101119  9:30:41  InnoDB: Completed initialization of buffer pool
101119  9:30:41  InnoDB: highest supported file format is Barracuda.
101119  9:30:41  InnoDB: 1.1.3 started; log sequence number 1650993
101119  9:30:41 [ERROR] Aborting

101119  9:30:41  InnoDB: Starting shutdown...
101119  9:30:47  InnoDB: Shutdown completed; log sequence number 1650993
101119  9:30:47 [Note]
101119 09:30:47 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
101119 09:34:15 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
101119  9:34:15 [ERROR] Error message file '/usr/share/mysql/english/errmsg.sys' had only 480 error messages,
but it should contain at least 705 error messages.
Check that the above file is the right version for this program!
/usr/libexec/mysqld: Unknown error 1146
101119  9:34:15 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
InnoDB: The InnoDB memory heap is disabled
InnoDB: Mutexes and rw_locks use GCC atomic builtins
InnoDB: Compressed tables use zlib 1.2.3
101119  9:34:15  InnoDB: Using Linux native AIO
101119  9:34:15  InnoDB: Initializing buffer pool, size = 128.0M
101119  9:34:15  InnoDB: Completed initialization of buffer pool
101119  9:34:15  InnoDB: highest supported file format is Barracuda.
101119  9:34:15  InnoDB: 1.1.3 started; log sequence number 1650993
101119  9:34:15 [ERROR] Aborting

101119  9:34:15  InnoDB: Starting shutdown...
101119  9:34:20  InnoDB: Shutdown completed; log sequence number 1650993
101119  9:34:20 [Note]
101119 09:34:20 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

I've attempted mysql_upgrade but of course I got error: 2002.

I'm not sure where to go from here, everything else I've found on google people generally have this problem fixed before it reaches the point that I'm at.
Need a clue, can anyone help?

d072330 11-19-2010 12:04 PM

Do this command to find your mysql.sock file:

cd /
find . -exec grep -i mysql.sock {} \;

Mine is located in /var/run/mysqld

You might try there first.

zushiba 11-19-2010 12:16 PM

yeah I tried it doesn't exist anywhere on the system.

d072330 11-19-2010 12:22 PM

Since your system is trying to find it here:

Quote:

socket=/var/lib/mysql/mysql.sock
Do the following:
touch /var/lib/mysql/mysql.sock
chown mysql:mysql /var/lib/mysql/mysql.sock
chmod 4777 /var/lib/mysql/mysql.sock

If the above does not work try this:
mysqladmin [-h ... -u ... -p...] shutdown -> This might not need to be done as yours is already shutdown. (service mysql/mysqld status to verify)
mysqld_safe --user=mysql &

that should restore your socket file...

zushiba 11-19-2010 12:41 PM

Code:

[root@bebop-test /]# touch /var/lib/mysql/mysql.sock
[root@bebop-test /]# chown mysql:mysql /var/lib/mysql/mysql.sock
[root@bebop-test /]# chmod 4777 /var/lib/mysql/mysql.sock
[root@bebop-test /]# mysqladmin [-h ... -u ... -p...] shutdown
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (111)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
[root@bebop-test /]# mysqld_safe --user=mysql &
[2] 13292
[root@bebop-test /]# 101119 10:40:35 mysqld_safe Logging to '/var/log/mysqld.log'.
101119 10:40:35 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
101119 10:40:41 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

[2]-  Done                    mysqld_safe --user=mysql

EDIT: Note my status as a newbie is not exaggerated, so expect some dumbness on my part if I did something wrong.

d072330 11-19-2010 12:43 PM

So did it create a sock file that looked like this:

srwxrwxrwx 1 mysql mysql 0 Nov 15 22:07 mysqld.sock

If not remove the lock file I had you touch as I forgot that this is a socket file (s at beginning) and cannot to my knowledge be created by hand. Then run this again:

mysqladmin [-h ... -u ... -p...] shutdown -> This might not need to be done as yours is already shutdown. (service mysql/mysqld status to verify)
mysqld_safe --user=mysql &

ll /var/lib/mysql/mysql.sock

Post what the ll returns.

zushiba 11-19-2010 01:06 PM

It didn't create mysql.sock
Code:

[root@bebop-test /]# mysqladmin [-h ... -u ... -p...] shutdown
mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!
[root@bebop-test /]# mysqld_safe --user=mysql &
[2] 14999
[root@bebop-test /]# 101119 11:04:45 mysqld_safe Logging to '/var/log/mysqld.log'.
101119 11:04:45 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
101119 11:04:51 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
[root@bebop-test /]# ll /var/lib/mysql/mysql.sock
ls: /var/lib/mysql/mysql.sock: No such file or directory
[2]-  Done                    mysqld_safe --user=mysql


d072330 11-19-2010 02:09 PM

Type which mysql should return something like this: /usr/bin/mysql

Whatever the first part of that is add this line to your my.cnf file where /usr is the first directory from which command.

basedir = /usr

then try and start mysql. You hopefully will get a different error message other than

Quote:

101119 09:12:12 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
101119 9:12:12 [ERROR] Error message file '/usr/share/mysql/english/errmsg.sys' had only 480 error messages,
but it should contain at least 705 error messages.
Check that the above file is the right version for this program!
/usr/libexec/mysqld: Unknown error 1146
101119 9:12:12 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.

zushiba 11-19-2010 02:17 PM

Code:

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

101119 12:16:21  InnoDB: Starting shutdown...
101119 12:16:27  InnoDB: Shutdown completed; log sequence number 1650993
101119 12:16:27 [Note]
101119 12:16:27 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended


d072330 11-19-2010 02:32 PM

Have you tried to run mysql_upgrade yet?

Also what are the permissions for these:
/var/lib/mysql
/var/run/mysqld


This is what is in my my.cnf file:

Quote:

user = mysql
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
port = 3306
basedir = /usr
datadir = /var/lib/mysql
tmpdir = /tmp

d072330 11-19-2010 02:38 PM

What version of Linux are you running?

d072330 11-19-2010 02:45 PM

You could also run this and post the output.

Quote:

/usr/bin/mysql --print-defaults
/usr/bin/mysql would have been started with the following arguments:
--port=3306 --socket=/var/run/mysqld/mysqld.sock

zushiba 11-19-2010 02:49 PM

mysql_upgrade won't run while mysqld isn't operating. Throws the same error
Code:

[root@bebop-test /]# 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

/var/lib/mysql is rwxr-xr-x 0755
/var/run/mysqld is rwxr-xr-x 0755
owner/group mysql

Linux version 2.6.18-194.26.1.el5 (mockbuild@x86-004.build.bos.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #1 SMP Fri Oct 29 14:21:16 EDT 2010



Code:

[root@bebop-test lib]# /usr/bin/mysql --print-defaults
/usr/bin/mysql would have been started with the following arguments:
--socket=/var/lib/mysql/mysql.sock


d072330 11-19-2010 02:57 PM

Try this command:

Quote:

whereis mysqld.sock
and then edit your my.cnf and write the new path.

Also your system might be looking for the my.cnf file else where (i.e. /etc/my.cnf instead of /etc/mysql/my.cnf). If this is the case you can fix like so:

Quote:

ln -s /etc/mysql/my.cnf /etc/my.cnf
You may also try this as well:

Quote:

mysql --socket=/var/run/mysqld/mysqld.sock

zushiba 11-19-2010 03:09 PM

I'm not sure how to interpret the results of whereis mysqld.sock
Code:

[root@bebop-test lib]# whereis mysqld.sock
mysqld: /usr/libexec/mysqld /usr/share/man/man8/mysqld.8.gz

The only my.cnf I have is /etc/my.cnf


mysql --socket=/var/run/mysqld/mysqld.sock returns
Code:

[root@bebop-test lib]# mysql --socket=/var/run/mysqld/mysqld.sock
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)


I've given up on trying to get the latest version from remi's repo working on this system. I've removed it and fell back to the default RHEL repo version. It seems to be working.

Thank you for all your help d072330 it was very appreciated and I learned a lot which I'd say pretty much makes the whole thing good :)

quanta 11-19-2010 08:07 PM

Hi,

Quote:

Originally Posted by zushiba (Post 4164576)
101119 9:12:12 [ERROR] Error message file '/usr/share/mysql/english/errmsg.sys' had only 480 error messages,
but it should contain at least 705 error messages.
Check that the above file is the right version for this program!
/usr/libexec/mysqld: Unknown error 1146

I had got this problem when updating MySQL to version 5.1.x. It seems that you are running 64-bit with a both of mysql.i386 and mysql.x86-64 version. And you got this problem because of the mysql-server upgrade to new version but the mysql-client still keep the old version. And the solution is download the source code of right mysql-server version which you are running, extract it, and copy the errmsg.sys to the correlative path in the server.

The next time, you should remove the mysql.i386 version before updating.

zushiba 11-19-2010 11:12 PM

That sounds reasonable. Since this is a test box I'm free to do just that. I'll give it a try when I get back to work Monday. Thanks for the tip I'll post to success or failure whichever comes first.

d072330 11-22-2010 11:06 AM

@quanta - good catch did not see that.

Hopefully that fixes the problem. Let us know.

zushiba 11-22-2010 11:14 PM

Well I did manage to get MySQL working correctly and creating it sock with a reinstall. However for whatever reason php-mysql would not install. I downgraded from 5.3.4(remi's latest release) to the 5.3.3 release which also didn't work. I removed that version and managed to get it working via this http://www.webtatic.com/blog/2009/06...0-on-centos-5/

ThreeDFX 06-18-2011 11:21 PM

Quote:

Originally Posted by quanta (Post 4164924)
Hi,


I had got this problem when updating MySQL to version 5.1.x. It seems that you are running 64-bit with a both of mysql.i386 and mysql.x86-64 version. And you got this problem because of the mysql-server upgrade to new version but the mysql-client still keep the old version. And the solution is download the source code of right mysql-server version which you are running, extract it, and copy the errmsg.sys to the correlative path in the server.

The next time, you should remove the mysql.i386 version before updating.

Thank you, so much. I registered just to say thanks. Been searching for hours with the same problem. I had added a non standard redhat repo to grab a php package from this century (seriously redhat, 5.1.6?). It pulled my mysql install from that repo and also carried over some x86 nonsense. I had to do the following:

- Wipe everything from the previous MySQL installs (including any conflicting files)
- Clean Yum
- Temporarily disable my custom repo

Worked just fine. Thank you for posting that and not just blowing the original poster off like almost every other forum thread found through google seems to be full of.

JINXING 07-04-2011 05:13 AM

vi /etc/my.cnf
# For low memory, Berkeley DB should not be used so keep skip-bdb uncommented unless required
#skip-bdb

comment out of the "skip-bdb" section.
TRY it.

Carnix 09-29-2011 07:08 PM

I had the same problem...
 
So, I was having the same issue. Exactly the same across the board -- all your posts and outputs matched my exactly. After hours or trolling google and beating my head against the wall I did something extraordinary.

I RTFM.... http://dev.mysql.com/tech-resources/...sql_intro.html

$ sudo mysql_install_db

It did some stuff... then when I started mysqld ($ sudo /sbin/service mysqld start) I got that wonderful... beautiful... [ OK ]

chris407x 04-18-2012 03:25 PM

Another cause of mysqld not restarting
 
I was backing up a database when this happened to me: mysqld would not restart, even after a system restart. What had happened in the middle of the backup was that the disk became 100% full and mysql could not even create its .pid file. Just run
Code:

df -h
to check your disk space.

revil 05-17-2013 10:09 PM

Quote:

Originally Posted by Carnix (Post 4485976)
So, I was having the same issue. Exactly the same across the board -- all your posts and outputs matched my exactly. After hours or trolling google and beating my head against the wall I did something extraordinary.

I RTFM.... http://dev.mysql.com/tech-resources/...sql_intro.html

$ sudo mysql_install_db

It did some stuff... then when I started mysqld ($ sudo /sbin/service mysqld start) I got that wonderful... beautiful... [ OK ]

Thanks, mate! It solved my problem!

HollywoodMarks 08-29-2013 09:15 PM

Thank you
 
Thank you for posting that. I also removed and re-installed, but it wasn't 'til after I ran the install line that it started.

# mysql_install_db


All times are GMT -5. The time now is 11:33 PM.