I have enabled SQL SLOW LOG Queries in my.cnf file but i need to restart mysql and when i try to run this command

sudo /etc/init.d/mysql restart

for restarting it throws this error.

Stopping MySQL database server: mysqld failed!
Starting MySQL database server: mysqld already running.
Warning: World-writable config file '/etc/mysql/debian.cnf' is ignored
/usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'

[Image] :

enter image description here

  • Firstly you must check your error log to see why MySQL server failed to stop
    – HamoonDBA
    Sep 11 '17 at 10:06

It's due to incorrect permissions on /etc/mysql/debian.cnf file.

Do a long-listing of that file first to check current permissions:

sudo ls -l /etc/mysql/debian.cnf

If group or other fields has write permission enabled, run:

sudo chmod 644 /etc/mysql/debian.cnf

and then restart mysql:

sudo /etc/init.d/mysql restart

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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