why does mysql give an access denied error for root@localhost? Print this Article
To avoid this issue, ensure that the MySQL
root password is in the
/root/.my.cnf file on the
- This is usually the first
rootpassword given when cPanel was installed.
If the MySQL
root password is not in the
/root/.my.cnf file, reset the
root password with the following steps:
1. Run the
/etc/rc.d/init.d/mysql stop command to stop
tailwatchd and 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"...
To address this issue, perform the following: Open the /etc/my.cnf file with your preferred...
Login to cPanel. Locate and click on the "MySQL Databases" icon within the "Databases"...
Write what are you looking for in the Search field. Click Go.
Login to cPanel. Locate and click on the "MySQL Databases" icon in the "Databases" category....