Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a server running CentOS 5.5 x86_64, and have recently installed MySQL Server via YUM, but when starting the server I get:

[root@server etc]# service mysqld start
Warning: World-writable config file '/etc/my.cnf' is ignored
Warning: World-writable config file '/etc/my.cnf' is ignored
Warning: World-writable config file '/etc/my.cnf' is ignored
Warning: World-writable config file '/etc/my.cnf' is ignored
Timeout error occurred trying to start MySQL Daemon.
Starting MySQL: [FAILED]

My my.cnf looks like this:

[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

And my mysqld.log looks like this:

111228 10:47:50 mysqld started
Warning: World-writable config file '/etc/my.cnf' is ignored
InnoDB: Log scan progressed past the checkpoint lsn 0 36808
111228 10:47:51 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...
InnoDB: Doing recovery: scanned up to log sequence number 0 43655
111228 10:47:51 InnoDB: Starting an apply batch of log records to the database... InnoDB: Progress in percents: 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 2728 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 5758 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
111228 10:47:51 InnoDB: Started; log sequence number 0 43655
111228 10:47:51 [ERROR] Fatal error: Can't open and lock privilege tables: Table'mysql.host' doesn't exist 111228 10:47:51 mysqld ended`

Can anyone point out why this is occurring?

share|improve this question

3 Answers 3

up vote 2 down vote accepted

First fix the permission for /etc/my.cnf. Since it is being ignored, your mysql instance is not able to find the database directory specified by datadir variable. If that does not works out then you can run the following to tell mysql the path to your db.

mysql_install_db --user=mysql --ldata=/var/lib/mysql/
share|improve this answer

I'd start with fixing the problems the error messages warn you about:

Warning: World-writable config file '/etc/my.cnf' is ignored

so e.g.:

chmod 0640 /etc/my.cnf

and then try starting it agian and see what it sais.

share|improve this answer
    
That didn't work, same error. –  Justin Dec 28 '11 at 11:30

You need to set the file permission to 644 at the very most. I've noticed scripts go crazy when its writable to the 'world'.

If you get any more similar issues but with directories, you need to set this to 755.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.