Mysql gives error of access denied for root@localhost on cPanel Servers

The most possible cause of this error is an incorrect password. You can usually find the correct password in this file:  /root/.my.cnf.

The file will contain the first root password the server was given once cPanel is installed. If it still does not work, you will need to reset the mysqld root password. To do so you can follow the below steps:

1. Stop mysqld – /etc/rc.d/init.d/mysql stop 
2. Stop chkservd to keep it from interfering with mysqld –/etc/rc.d/init.d/chkservd stop 
3. Start mysqld without the grant tables –  mysqld –skip-grant-tables -u mysql & 
4. Now 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.

 

 

Both comments and pings are currently closed.

Comments are closed.