Home > Article > Backend Development > mysqli_connect: HY000/2002: Permission denied
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.