Home > MySQL and databases > Mysql gives error of access denied for root ?

Mysql gives error of access denied for root ?

October 6th, 2009

Make sure root pass is in /root/.my.cnf
This is usually the first mysql root pass the box was given once cpanel is installed.
If it still does not work, you will need to reset the mysqld root pass.

First, stop the mysqld, usually
/etc/rc.d/init.d/mysql stop

Then stop chkservd to keep it from interfering with mysqld while you work on it
with /etc/rc.d/init.d/chkservd stop

Start up mysqld , but, without the grant tables,

mysqld –skip-grant-tables -u mysql &

Then change the pass..

mysql -u root mysql

UPDATE user SET Password=PASSWORD(’new_password’) WHERE user=’root’;

FLUSH PRIVILEGES;

Now you just
killall -9 mysqld

and start it up normally with it’s safe_mysqld script..

safe_mysqld –skip-grant-tables & /usr/local/cpanel/startup

MySQL and databases

  1. No comments yet.
  1. No trackbacks yet.
You must be logged in to post a comment.