LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 08-14-2013, 09:10 AM   #1
bluegospel
Member
 
Registered: Jan 2010
Distribution: centOS
Posts: 404

Rep: Reputation: 53
Trouble starting mysqld


Hi.

I'm running Centos 5.8. I've recently started using my system under -su rather that logging directly into the system as root. In the process I accidentally set the owner of /var and all subdirectories to a regular user. Having now rebooted the system, I'm having trouble starting mysqld. When I attempt to do so this output is written to the log file:

----------

130814 09:02:35 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130814 9:02:35 [Note] libgovernor.so not found
130814 9:02:35 [Note] Plugin 'FEDERATED' is disabled.
/usr/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
130814 9:02:35 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
130814 9:02:35 InnoDB: The InnoDB memory heap is disabled
130814 9:02:35 InnoDB: Mutexes and rw_locks use InnoDB's own implementation
130814 9:02:35 InnoDB: Compressed tables use zlib 1.2.3
130814 9:02:35 InnoDB: Using Linux native AIO
130814 9:02:35 InnoDB: Initializing buffer pool, size = 128.0M
130814 9:02:35 InnoDB: Completed initialization of buffer pool
130814 9:02:35 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
130814 9:02:35 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
130814 9:02:36 InnoDB: Waiting for the background threads to start
130814 9:02:37 InnoDB: 1.1.8 started; log sequence number 7835625
130814 9:02:37 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130814 9:02:37 [Note] - '0.0.0.0' resolves to '0.0.0.0';
130814 9:02:37 [Note] Server socket created on IP: '0.0.0.0'.
130814 9:02:37 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
130814 9:02:37 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
130814 09:02:37 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended

----------

So my question is, how do I attack this?
 
Old 08-14-2013, 09:47 AM   #2
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278

Rep: Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694Reputation: 1694
Change the owner to what it should be.

chown -R mysql.mysql /var/lib/mysql

make sure /var and /var/lib retain their root.root ownership and 755 mode.
 
2 members found this post helpful.
Old 08-14-2013, 09:51 AM   #3
bluegospel
Member
 
Registered: Jan 2010
Distribution: centOS
Posts: 404

Original Poster
Rep: Reputation: 53
Quote:
Originally Posted by szboardstretcher View Post
Change the owner to what it should be.

chown -R mysql.mysql /var/lib/mysql

make sure /var and /var/lib retain their root.root ownership and 755 mode.
Thanks. I'll try that.
 
Old 08-14-2013, 10:18 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by bluegospel View Post
Hi.
I'm running Centos 5.8. I've recently started using my system under -su rather that logging directly into the system as root. In the process I accidentally set the owner of /var and all subdirectories to a regular user.
...and THIS is a very good example of why you don't log in as root, or use root regularly. Root and sudo access should be used like salt on your food....a little bit goes a LONG way, and you should only use it when you NEED to.
Quote:
Having now rebooted the system, I'm having trouble starting mysqld. When I attempt to do so this output is written to the log file:
----------
130814 09:02:35 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130814 9:02:35 [Note] libgovernor.so not found
130814 9:02:35 [Note] Plugin 'FEDERATED' is disabled.
/usr/libexec/mysqld: Can't find file: './mysql/plugin.frm' (errno: 13)
130814 9:02:35 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.
130814 9:02:35 InnoDB: The InnoDB memory heap is disabled
130814 9:02:35 InnoDB: Mutexes and rw_locks use InnoDB's own implementation
130814 9:02:35 InnoDB: Compressed tables use zlib 1.2.3
130814 9:02:35 InnoDB: Using Linux native AIO
130814 9:02:35 InnoDB: Initializing buffer pool, size = 128.0M
130814 9:02:35 InnoDB: Completed initialization of buffer pool
130814 9:02:35 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
130814 9:02:35 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
130814 9:02:36 InnoDB: Waiting for the background threads to start
130814 9:02:37 InnoDB: 1.1.8 started; log sequence number 7835625
130814 9:02:37 [Note] Server hostname (bind-address): '0.0.0.0'; port: 3306
130814 9:02:37 [Note] - '0.0.0.0' resolves to '0.0.0.0';
130814 9:02:37 [Note] Server socket created on IP: '0.0.0.0'.
130814 9:02:37 [ERROR] /usr/libexec/mysqld: Can't find file: './mysql/host.frm' (errno: 13)
130814 9:02:37 [ERROR] Fatal error: Can't open and lock privilege tables: Can't find file: './mysql/host.frm' (errno: 13)
130814 09:02:37 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
----------
So my question is, how do I attack this?
You quite obviously know what you DID....so you also know what to UNDO, right??? That is, change ownership back to root, as szboardstretcher said. MySQL is giving you a permissions error (which is also easy to look up on Google), which tell you how to fix the issue. However, since you did it for the /var directory recursively, don't you have that command in your .bash_history/shell history file? Bring the command back, and replace the 'regular' user ID with root.

Also, be very glad that the reboot actually WORKED, since rebooting a system after you make a wholesale change on a system directory can often times cause LOTS of problems, if it reboots at all.
 
Old 08-14-2013, 10:21 AM   #5
bluegospel
Member
 
Registered: Jan 2010
Distribution: centOS
Posts: 404

Original Poster
Rep: Reputation: 53
Thank you very much. It worked.

Also thank you linux Q members for pushing me in the past to do the necessary research first. At the time it seemed overwhelming but I'm getting a lot better now. Thanks again!
 
Old 08-14-2013, 11:17 AM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by bluegospel View Post
Thank you very much. It worked.
Glad to hear it.
Quote:
Also thank you linux Q members for pushing me in the past to do the necessary research first. At the time it seemed overwhelming but I'm getting a lot better now. Thanks again!
Not meaning to sound nasty, but if you DID research the question, you'd have found the solution before posting the question. Lots of hits on Google and on the MySQL site.
 
  


Reply



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
TimeOut error while starting mysqld deamon vinaytp Linux - Newbie 9 08-25-2010 10:01 AM
Trouble starting mysqld koodoo Linux - Newbie 4 08-16-2005 10:09 AM
starting mysqld + OpenBSD Gsee *BSD 0 02-01-2005 05:36 AM
starting mysqld zobra Linux - Software 6 12-06-2004 11:27 PM
HELP! mysqld starting problem pravi Linux - Software 1 10-27-2004 11:20 AM

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

All times are GMT -5. The time now is 12:09 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