mysql permissions issue - associated with my.cnf

I want to change the max_allowed_packet value, but when setting permissions for my.cnf to 777, I get (as expected):

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

If I set it to anything less than that (600, 644, 700, 775, all tried...), the mysqld service fails to start.

EDIT: I now have its permissions set to 644

EDIT: The error log when the service fails to restart is:

110814 16:05:57 [Note] /usr/libexec/mysqld: Normal shutdown

110814 16:05:57 InnoDB: Starting shutdown...

110814 16:05:59 InnoDB: Shutdown completed; log sequence number 0 47678

110814 16:05:59 [Note] /usr/libexec/mysqld: Shutdown complete

110814 16:05:59 mysqld_safe mysqld from pid file/var/run/mysqld/mysqld.pid ended

EDIT: The previous error messages I had provided were produced only when permissions for my.cnf were 777. Now that they are at 644, this is all I get.

I believe this has to do with the permissions set to some files, as I found many files being set to 777. I don't know much, but I know that's bad. :) Thing is though, I don't know where to start looking and fixing.

The system all this is done on is CentOS 5.6.

If anyone has any suggestions about this, it will be highly appreciated.

EDIT: This has finally gotten solved. It was achieved by changing the bind-address inside my.cnf from the actual IP to 127.0.0.1 . No other action was required. Thank you all for your help.


Solution 1:

First off, I'll echo Shane's comments about permissions. Never, ever set anything 0777 (or 0666). If you think you need those permissions, quite frankly, you are Doing It Wrong.

Now, onto your problem. The logs are fairly clear, if you mentally filter out the things that don't scream [ERROR] at you. The first line, in particular, actually gives you the answer:

Can't open the mysql.plugin table. Please run mysql_upgrade to create it.

"Please run mysql_upgrade to create it" is pretty much all you need to know. Run that tool and it should update your mysql schema for awesome winnage.

Solution 2:

Don't change the permissions from their defaults - it's refusing to use that config file to protect you from yourself.

Fix the permissions (644 is probably where it should be), then if it continues to error, edit the new error into your question.