LinuxQuestions.org

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

zushiba 11-19-2010 12:59 PM

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 01: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 01:16 PM

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

d072330 11-19-2010 01: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 01: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 01: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 02: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 03: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 03: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 03: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 03:38 PM

What version of Linux are you running?

d072330 11-19-2010 03: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 03: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 03: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 04: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 :)


All times are GMT -5. The time now is 09:52 AM.