Linode.com Forum Forum Index Linode.com Forum
Linode Community Forums
 


MySQL doesn't start after restart

Click here to go to the original topic

 
       Linode.com Forum Forum Index -> Linux, Apache, Mysql and PHP (LAMP) Forum
Author Message
lec



Joined: 24 Sep 2005
Posts: 34

Posted: Wed Jul 19, 2006 8:41 pm    Post subject: MySQL doesn't start after restart  

Hi,

A couple of days ago I found my linode to be turned off. It was running fine for months, I have no idea what could've happened. Anyways, it happened around 10 am on July 16th. When I noticed it, of course I started the server but got a whole bunch of errors. I submitted a ticket and they helped me get rid of all but one. This one, however, is preventing my MySQL server to start and therefore my server is still down. :(
I get the following error in /var/log/mysql.log:
Code: 060718 18:48:42  mysqld started
060718 18:48:43 [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.host' doesn't exist
060718 18:48:43  mysqld ended

Through the ticket system I was told that it's a missing table and to look in the manual. The problem is that the table is there:
Code: [root@li10-76 ~]# ls -al /usr/local/mysql/data/mysql/host.*
-rw-rw----  1 mysql mysql 9148 Jun 29 20:32 /usr/local/mysql/data/mysql/host.frm
-rw-rw----  1 mysql mysql    0 Jun 29 20:32 /usr/local/mysql/data/mysql/host.MYD
-rw-rw----  1 mysql mysql 1024 Jun 29 20:32 /usr/local/mysql/data/mysql/host.MYI

Anybody has any thoughts on what could've happened and how to fix this?

Thanks,
LEC
Back to top  
caker



Joined: 15 Apr 2003
Posts: 2387
Location: Galloway, NJ

Posted: Wed Jul 19, 2006 9:00 pm    Post subject:  

Hmm... Is there another install of mysql, or rather, another config which is telling mysqld to look for tables in an improper location?

-Chris
Back to top  
lec



Joined: 24 Sep 2005
Posts: 34

Posted: Wed Jul 19, 2006 10:24 pm    Post subject:  

Not that I know of. This is what I found:
Code: [root@li10-76 /]# find -name *.cnf
./etc/my.cnf
./usr/libexec/webmin/acl/openssl.cnf
./usr/share/doc/dovecot-0.99.11/dovecot-openssl.cnf
./usr/share/doc/mysql-server-5.0.22/my-large.cnf
./usr/share/doc/mysql-server-5.0.22/my-huge.cnf
./usr/share/doc/mysql-server-5.0.22/my-innodb-heavy-4G.cnf
./usr/share/doc/mysql-server-5.0.22/my-medium.cnf
./usr/share/doc/mysql-server-5.0.22/my-small.cnf
./usr/share/ssl/openssl.cnf
./usr/local/mysql/support-files/my-huge.cnf
./usr/local/mysql/support-files/my-innodb-heavy-4G.cnf
./usr/local/mysql/support-files/my-large.cnf
./usr/local/mysql/support-files/my-medium.cnf
./usr/local/mysql/support-files/my-small.cnf
./usr/local/mysql/mysql-test/std_data/ndb_config_mycnf1.cnf
./usr/local/mysql/mysql-test/std_data/ndb_config_mycnf2.cnf
[root@li10-76 /]#

This just happened after I found my linode off. I have no idea how that happened either.

LEC
Back to top  
OverlordQ



Joined: 04 Jun 2004
Posts: 200

Posted: Thu Jul 20, 2006 6:23 pm    Post subject:  

make sure the datadir config option is pointing to /usr/local/mysql/data/
Back to top  
lec



Joined: 24 Sep 2005
Posts: 34

Posted: Thu Jul 20, 2006 7:50 pm    Post subject:  

Well, I added the datadir line to my my.cnf because it wasn't there and now it works. How on Earth was this running before if I didn't have this line or what deleted this line from my.cfm all of a sudden? Must have been the same thing that turned my linode off. I noticed though that if I do a reboot it just turns the server off, it's not coming back on again. Is that normal?

Anyways, thank you very much OverlordQ for your help.

LEC
Back to top  
pclissold



Joined: 24 Oct 2003
Posts: 471
Location: Netherlands

Posted: Fri Jul 21, 2006 7:08 am    Post subject:  

lec wrote: I noticed though that if I do a reboot it just turns the server off, it's not coming back on again. Is that normal?

Command line reboot from inside the Linode shuts the Linode down OK but the restart fails because some Linode-specific tasks have to be performed prior to booting. This is handled by Linode Platform Manager boot/reboot facility or a reboot command issued from the Lish console.
Back to top  
 
       Linode.com Forum Forum Index -> Linux, Apache, Mysql and PHP (LAMP) Forum
Page 1 of 1