MySQL: "Access Denied" for Non-Root Users
When attempting to log into MySQL as a non-root user, you may encounter the error "Access denied for user 'test'@'localhost' (using password: YES)" despite following the standard user creation and privilege assignment procedures.
To resolve this issue, avoid granting excessive privileges to non-root users. Instead, grant specific privileges for specific databases using the following syntax:
For example:
You can verify user permissions and host access by executing the following query as the "root" user:
Remember to consult the official MySQL documentation for a comprehensive list of available privileges.
The above is the detailed content of Why Am I Getting 'Access Denied' in MySQL for Non-Root Users?. For more information, please follow other related articles on the PHP Chinese website!