Home >Database >Mysql Tutorial >How to Fix 'Access Denied for User' Error in Remote MySQL Connections on Windows XP?

How to Fix 'Access Denied for User' Error in Remote MySQL Connections on Windows XP?

Susan Sarandon
Susan SarandonOriginal
2024-12-14 01:24:14797browse

How to Fix

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:

  1. Log into the MySQL server as the 'root' user locally.
  2. Execute the following SQL statement to create a specific user entry for remote access:
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 '%'.

  1. Flush the privilege tables:
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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn