Add to Favourites Add to Favourites    Print this Article Print this Article

Mysql gives error of access denied for root@localhost ?

This is usually the first 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. To do so:
  1. Stop the mysqld.
    • Usually /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. 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.

Was this answer helpful?

Also Read