Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
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.
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!
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.