LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-30-2008, 01:05 AM   #1
nathacof
Member
 
Registered: Aug 2004
Location: Bear, DE, USA
Distribution: Slackware 11, CentOS 5.2, Ubuntu
Posts: 124

Rep: Reputation: 17
MySQL won't start.


Hey Guys,

I'm having a problem with MySQL startup on my CentOS server. Basically I'm using DRBD to replicate the /var/lib/mysql directory between two nodes.

The problem is, when trying to run the systems startup script for MySQL, I'm getting a time out error:
Code:
[root@mysql-primary ~]# service mysqld start
Timeout error occurred trying to start MySQL Daemon.
Starting MySQL:                                            [FAILED]
[root@mysql-primary ~]#
Code:
[root@mysql-primary ~]# tail /var/log/mysqld.log

081030 02:02:30  mysqld ended

081030 03:00:39  mysqld started
081030  3:00:40  InnoDB: Started; log sequence number 0 43655
081030  3:00:40 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
081030  3:00:40 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
081030  3:00:40 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
081030 03:00:40  mysqld ended

[root@mysql-primary ~]#
Permissions look good on the MySQL directory:

Code:
[root@mysql-primary ~]# ls -la /var/lib/mysql/
total 20564
drwxr-xr-x  4 mysql mysql     4096 Oct 30 03:00 .
drwxr-xr-x 24 root  root      4096 Oct 30 03:00 ..
-rw-rw----  1 mysql mysql 10485760 Oct 30 01:44 ibdata1
-rw-rw----  1 mysql mysql  5242880 Oct 30 03:00 ib_logfile0
-rw-rw----  1 mysql mysql  5242880 Oct 23 04:20 ib_logfile1
drwxrwx---  2 mysql mysql     4096 Oct 23 04:15 mysql
drwxrwx---  2 mysql mysql     4096 Oct 23 15:16 test
[root@mysql-primary ~]#
However if I run mysqld_safe from the command line the service starts up fine.

o_0 anyone know what's up here?
 
Old 10-30-2008, 01:25 AM   #2
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Does host.frm exist?

How did you install mysql-server?
 
Old 10-30-2008, 08:20 AM   #3
nathacof
Member
 
Registered: Aug 2004
Location: Bear, DE, USA
Distribution: Slackware 11, CentOS 5.2, Ubuntu
Posts: 124

Original Poster
Rep: Reputation: 17
Indeed it does. I created all the mysql system tables by running `mysql_install_db` after mounting the DRBD partition to /var/lib/mysql. MySQL was installed from the standard CentOS repoes (yum install mysqld).

The init script basically just calls mysqld_safe with the options ascertained from the my.cnf file, this does not work. However if I run:

$ mysqld_safe&

Then MySQL starts without issue...

Last edited by nathacof; 10-30-2008 at 08:31 AM.
 
Old 10-30-2008, 09:09 AM   #4
chickenjoy
Member
 
Registered: Apr 2007
Distribution: centos,rhel, solaris
Posts: 239

Rep: Reputation: 30
Quote:
Then MySQL starts without issue...
There must be something wrong in the my.cnf file that prevents it from running. Thats why if you can mysqld_safe& without the integrating the my.cnf (with a problematic entry) it runs smoothly. Try to remove some lines one at a time in my.cnf and try to start the mysql service.

I'm not an expert in this, it may or may not be the reason.
 
Old 10-30-2008, 09:58 AM   #5
nathacof
Member
 
Registered: Aug 2004
Location: Bear, DE, USA
Distribution: Slackware 11, CentOS 5.2, Ubuntu
Posts: 124

Original Poster
Rep: Reputation: 17
Aye, that's what I would assume as well, but it's fairly limited my.cnf file:

Code:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql

old_passwords=1

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
I don't see any problems there...

Last edited by nathacof; 10-30-2008 at 10:26 AM.
 
Old 10-30-2008, 10:07 AM   #6
billymayday
LQ Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
How did you mount thew DRBD partition?
 
Old 10-30-2008, 10:46 AM   #7
nathacof
Member
 
Registered: Aug 2004
Location: Bear, DE, USA
Distribution: Slackware 11, CentOS 5.2, Ubuntu
Posts: 124

Original Poster
Rep: Reputation: 17
Well, heartbeat was configured to start the resource:
Code:
mysql-primary drbddisk Filesystem::/dev/drdb0::/var/lib/mysql::ext3 mysqld
But since the mysql startup script was failing, it was causing huge amounts of load on my server. So I disabled heartbeat to see if I could get things started manually.

Basically to get things working I can run:

Code:
$ drdbadmin primary r0
$ mount /dev/drbd0 /var/lib/mysql
$ mysqld_safe&
At which point I can login to MySQL and perform queries as expected.

Any assistance you can provide is greatly appreciated!

Last edited by nathacof; 10-30-2008 at 11:23 AM.
 
Old 10-30-2008, 11:09 PM   #8
nathacof
Member
 
Registered: Aug 2004
Location: Bear, DE, USA
Distribution: Slackware 11, CentOS 5.2, Ubuntu
Posts: 124

Original Poster
Rep: Reputation: 17
Would it help if I posted the mysqld init script?

http://pastebin.com/m3145dbaa
 
Old 11-03-2008, 05:20 AM   #9
sachin_shetty
Member
 
Registered: Jul 2006
Posts: 40

Rep: Reputation: 15
Hi All;

I have Downloaded and Instlled Mysql 5.1-server on my Centos -el5 Machine.Installation was went pair
there was no error.
But while starting mysql I am getting this kind of error
service mysqld start
Timeout error occurred trying to start MySQL Daemon.
Starting MySQL: [FAILED]

and this is the mysql logs
tail /var/log/mysqld.log

081030 02:02:30 mysqld ended

081030 03:00:39 mysqld started
081030 3:00:40 InnoDB: Started; log sequence number 0 43655
081030 3:00:40 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/NTT.err' (errno: 13)
081030 3:00:40 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/mysql.sock' (errno: 13)
081030 3:00:40 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
081030 03:00:40 mysqld ended

and while i am logging into the mysql (mysql -root -p )

its prompting for the password and after its giving an error


ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)


Please can anybody help me out.

sachin_shetty
 
Old 11-03-2008, 05:45 AM   #10
robertjinx
Member
 
Registered: Oct 2007
Location: Prague, CZ
Distribution: RedHat / CentOS / Ubuntu / SUSE / Debian
Posts: 749

Rep: Reputation: 73
I have the impression that mysql doesnt know from where to take the files I mean like /var/lib/mysql. If its clasic mysql instalation from rpm, you should try to see configuration file /etc/sysconfig/mysql or mysqld and see there if is some options, or try the init script and set the "datadir" from whatever it is to "/var/lib/mysql".

Also check the rights of the folder /var/lib/mysql, it should be owned by mysql so... that might also be an issue.
 
Old 11-03-2008, 05:51 AM   #11
robertjinx
Member
 
Registered: Oct 2007
Location: Prague, CZ
Distribution: RedHat / CentOS / Ubuntu / SUSE / Debian
Posts: 749

Rep: Reputation: 73
Sorry I was wrong about the owner ship of the mysql folder, seems to be mysql. Anyway seems that error 13 means permission denied. Check more on google.com, also check that mount point...
 
Old 11-03-2008, 06:13 PM   #12
nathacof
Member
 
Registered: Aug 2004
Location: Bear, DE, USA
Distribution: Slackware 11, CentOS 5.2, Ubuntu
Posts: 124

Original Poster
Rep: Reputation: 17
Yeah... still got nothing on this. The ownership of the /var/lib/mysql directory is correct. I've got everything working here except for the darned script that's supposed to make sure that the service is working. It would sure be nice to get this sorted out.

/etc/sysconfig/mysql(d) does not exist on my servers.

If there's anyone out there who has experienced similar problems please let me know how you corrected the issue!

Code:
[root@mysql-primary ~]# mysqld_safe&
[1] 4810
[root@mysql-primary ~]# Starting mysqld daemon with databases from /var/lib/mysql

[root@mysql-primary ~]# /etc/init.d/mysqld restart
STOPPING server from pid file /var/run/mysqld/mysqld.pid
081103 20:15:26  mysqld ended

Stopping MySQL:                                            [  OK  ]
Timeout error occurred trying to start MySQL Daemon.
Starting MySQL:                                            [FAILED]
[1]+  Done                    mysqld_safe
[root@mysql-primary ~]#
/bangHead

Am I missing something in regards to DRBD?

Last edited by nathacof; 11-03-2008 at 06:36 PM.
 
Old 08-23-2011, 04:52 AM   #13
makundib
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Rep: Reputation: 0
This might be of help for you as well

http://www.linuxquestions.org/questi...b-mysq-689872/
 
Old 08-23-2011, 05:03 AM   #14
jsaravana87
Member
 
Registered: Aug 2011
Location: Chennai,India
Distribution: Redhat,Centos,Ubuntu,Dedian
Posts: 558
Blog Entries: 5

Rep: Reputation: Disabled
HI,


start mysql by using


/etc/init.d/mysqld restart

it will start
 
  


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
Fedora 9:No mysql.sock file found. Cannot start mysql smilingbuddha Linux - Software 3 03-21-2009 03:06 AM
Starting MySQL OLD Error : imeout error occurred trying to start MySQL Daemon Fr33B5D Linux - Software 9 10-28-2006 06:23 AM
MySQL - Timeout error occurred trying to start MySQL Daemon. stuartornum Linux - Software 3 02-26-2006 12:54 PM
Can't start mysql krilen Linux - Software 17 08-25-2004 01:39 AM
MySql error 2002, Cannot start mysql djchris Linux - Software 5 04-13-2004 06:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:03 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration