Home > Database > Mysql Tutorial > Why Am I Getting 'Access Denied' in MySQL for Non-Root Users?

Why Am I Getting 'Access Denied' in MySQL for Non-Root Users?

Linda Hamilton
Release: 2024-12-11 01:40:09
Original
643 people have browsed it

Why Am I Getting

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!

Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template