Home  >  Article  >  Backend Development  >  mysqli_connect: HY000/2002: Permission denied

mysqli_connect: HY000/2002: Permission denied

WBOY
WBOYOriginal
2016-08-08 09:23:493370browse

mysqli_connect(): (HY000/2002): Permission denied

When configuring the PHP development environment under Linux, this error was reported. I started to think that it was a username + password problem, which caused the database to not be successfully logged in. Repeatedly After checking, it was found that it was not a password problem

In the online search results: it was suggested to change the host connected to mysql from: localhost to 127.0.0.1, but I originally set it to: 127.0.0.1

The problem was not solved in other places

So, I boldly tried 127.0.0.1 Changed to localhost

Problem solved, access successful

The principle will be written in detail next time ~

The above introduces mysqli_connect: HY000/2002: Permission denied, including the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

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