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

I want to edit the /etc/my.cnf file.

I've tried to use this as the file content:

[mysqld]
set-variable = max_allowed_packet=24M
set-variable = max_connections=300
log-slow-queries
safe-show-database
local-infile=0
open_files_limit=3980 

then, I've tried to restart the mysql server:

/etc/rc.d/init.d/mysql restart

but it failed with the following error:

root@server1 [~]# /etc/rc.d/init.d/mysql restart
Shutting down MySQL.... [ OK ]
Starting MySQL...The server quit without updating PID file (/var/lib/mysql server1.domain.com.pid). [FAILED]

I've read here that I need to replace [mysqld] with [mysql], but he is using Percona, and I am just using a standart whm/cpanel installation, will it work too?

share|improve this question
2  
You need to read the error log and find out what's preventing MySQL from starting. –  dawud Jun 21 at 10:55
1  
2  
FWIW, I'm not aware that set-variable = max_allowed_packet=24M is valid my.cnf syntax. You set variables by just putting the name=value pair in there. –  Felix Frank Jun 21 at 11:07
    
ah so this is the right syntax, previously is for old mysql syntax [mysqld] max_allowed_packet=24M max_connections=300 log-slow-queries local-infile=0 open_files_limit=3980 btw if i add safe-show-database, got FAILED message too, is it already changed too? –  Earl Jun 21 at 21:44

1 Answer 1

First of all check mysql logs and error logs to see whats going on with mysql service,if you see no error logs than you can deploy these steps.

Check if there is any running MySQL process

ps aux | grep mysql

If you are able to see any mysql process like below, just kill that process.

kill -9 pid

Make sure that there is no mysql process running at this point. Restart MySQL.

OR

Try moving the mysql config file /etc/my.cnf file and restart mysql.

mv /etc/my.cnf /etc/my.cnf.backup

Restart mysql.

OR

Try to move the log file named ib_logfile in /var/lib/mysql and restart mysql. Sometimes mysql will fail because it face difficulty updating the log file.

mv /var/lib/mysql/ib_logfile* /root/

Restart and see the results.

service mysqld restart

You can also remove ib_logfile as it will be created automatically after mysql restart.

share|improve this answer
2  
omg, why all this fuss instead of just opening your error log ?? –  ADM Jun 21 at 11:05

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.