LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 11-19-2010, 11:59 AM   #1
zushiba
LQ Newbie
 
Registered: Sep 2007
Posts: 15

Rep: Reputation: 0
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?

Last edited by zushiba; 11-19-2010 at 12:00 PM.
 
Old 11-19-2010, 12:04 PM   #2
d072330
Member
 
Registered: Nov 2007
Location: USA
Distribution: CentOS
Posts: 174

Rep: Reputation: 6
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.
 
Old 11-19-2010, 12:16 PM   #3
zushiba
LQ Newbie
 
Registered: Sep 2007
Posts: 15

Original Poster
Rep: Reputation: 0
yeah I tried it doesn't exist anywhere on the system.
 
Old 11-19-2010, 12:22 PM   #4
d072330
Member
 
Registered: Nov 2007
Location: USA
Distribution: CentOS
Posts: 174

Rep: Reputation: 6
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...
 
Old 11-19-2010, 12:41 PM   #5
zushiba
LQ Newbie
 
Registered: Sep 2007
Posts: 15

Original Poster
Rep: Reputation: 0
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.

Last edited by zushiba; 11-19-2010 at 12:43 PM.
 
Old 11-19-2010, 12:43 PM   #6
d072330
Member
 
Registered: Nov 2007
Location: USA
Distribution: CentOS
Posts: 174

Rep: Reputation: 6
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.
 
Old 11-19-2010, 01:06 PM   #7
zushiba
LQ Newbie
 
Registered: Sep 2007
Posts: 15

Original Poster
Rep: Reputation: 0
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
 
Old 11-19-2010, 02:09 PM   #8
d072330
Member
 
Registered: Nov 2007
Location: USA
Distribution: CentOS
Posts: 174

Rep: Reputation: 6
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.

Last edited by d072330; 11-19-2010 at 02:10 PM.
 
Old 11-19-2010, 02:17 PM   #9
zushiba
LQ Newbie
 
Registered: Sep 2007
Posts: 15

Original Poster
Rep: Reputation: 0
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
 
Old 11-19-2010, 02:32 PM   #10
d072330
Member
 
Registered: Nov 2007
Location: USA
Distribution: CentOS
Posts: 174

Rep: Reputation: 6
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
 
Old 11-19-2010, 02:38 PM   #11
d072330
Member
 
Registered: Nov 2007
Location: USA
Distribution: CentOS
Posts: 174

Rep: Reputation: 6
What version of Linux are you running?
 
Old 11-19-2010, 02:45 PM   #12
d072330
Member
 
Registered: Nov 2007
Location: USA
Distribution: CentOS
Posts: 174

Rep: Reputation: 6
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
 
Old 11-19-2010, 02:49 PM   #13
zushiba
LQ Newbie
 
Registered: Sep 2007
Posts: 15

Original Poster
Rep: Reputation: 0
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

Last edited by zushiba; 11-19-2010 at 02:50 PM.
 
Old 11-19-2010, 02:57 PM   #14
d072330
Member
 
Registered: Nov 2007
Location: USA
Distribution: CentOS
Posts: 174

Rep: Reputation: 6
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
 
Old 11-19-2010, 03:09 PM   #15
zushiba
LQ Newbie
 
Registered: Sep 2007
Posts: 15

Original Poster
Rep: Reputation: 0
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

Last edited by zushiba; 11-19-2010 at 04:25 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
mysql daemon won't start on boot Foress_89 Slackware 12 01-03-2009 12:53 PM
mysql failed to start. reinstall failed either!!! gavin2u Linux - Server 10 11-13-2008 10:07 PM
mysql daemon fail to start on slackware 10.2 sharathg786 Linux - Server 6 10-05-2006 02:53 PM
MySQL - Timeout error occurred trying to start MySQL Daemon. stuartornum Linux - Software 3 02-26-2006 12:54 PM
can't start mysql daemon IceGrill Linux - Software 3 07-29-2003 07:16 PM


All times are GMT -5. The time now is 02:19 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration