why does mysql give an access denied error for root@localhost?
To avoid this issue, ensure that the MySQL
rootpassword is in the
/root/.my.cnffile on the
- This is usually the first
rootpassword given when cPanel was installed.
If the MySQL
rootpassword is not in the
/root/.my.cnffile, reset the
rootpassword with the following steps:
1. Run the
/etc/rc.d/init.d/mysql stopcommand to stop
tailwatchdand temporarily disable it:# touch /etc/tailwatchddisable # killall tailwatchd
3. Run the
mysqld --skip-grant-tables -u mysqlcommand to start
4. Run the
# mysql -u root mysql -e "UPDATE user SET Password=PASSWORD('new_password') WHERE user='root'; FLUSH PRIVILEGES;"command to change the password.
5. Run the
killall mysqldcommand to start the MySQL normally with the
6. Run the
7. Delete the
tailwatchddisablefile you created with the
8. Run the
Was this answer helpful?
Login to cPanel. Locate and click on the "MySQL Databases" icon under the "Databases"...
Run one of the following commands: /path/to/bin/mysqldump -u $mysqlusername...
Login to cPanel. Locate and click on the "MySQL Databases" icon in the "Databases" category....
You have MySQL version 4.0.12 which has a bug that causes this error. Upgrade to a later version...
Login to cPanel. Locate and click on the "MySQL Databases" icon within the "Databases"...