Remote MySQL Connection Error: Access Denied for Remote Root User
Problem:
Users are unable to establish a remote connection to a MySQL database running on Windows XP, encountering the error message "ERROR 1045 (28000): Access denied for user."
Cause:
The MySQL user table ('mysql.user') lacks an entry specifically allowing remote access for the 'root' user.
Solution:
To enable remote connectivity, follow these steps:
GRANT ALL PRIVILEGES ON *.* TO 'USERNAME'@'IP' IDENTIFIED BY 'PASSWORD' with grant option;
Replace 'USERNAME' with the username for remote access, 'IP' with the specific IP address to allow, and 'PASSWORD' with the corresponding password. If remote access is to be allowed from any IP, replace 'IP' with '%'.
FLUSH PRIVILEGES;
Alternatively, restart the MySQL server to apply the changes.
Verification:
After completing these steps, users should be able to establish remote connections to the MySQL database using the specified username, password, and IP address.
The above is the detailed content of How to Fix 'Access Denied for User' Error in Remote MySQL Connections on Windows XP?. For more information, please follow other related articles on the PHP Chinese website!