I created a user in phpMyAdmin and I only want to allow query, insert and update operations, and in my php file I am trying to connect to the MySQL database but always get the error Warning: mysqli::mysqli(): (HY000/1045): Access denied for user 'me'@'localhost' (using password: YES)
, even though I entered the parameter to the mysqli constructor correctly. I read that I should tick the GRANT
checkbox for the user however that didn't fix it. What am I missing here? Knowing that if I try it using root and no password I can connect successfully.
Mysql – phpMyAdmin new user can’t connect to database
MySQLPHPphpmyadmin
Best Answer
In a comment, I asked you to run the following queries to diagnose your issue:
Your answer suggests the user you created is
balsam
. This makes your issue very obvious -- you're attempting to connect to MySQL as userme
, please use the correct usernamebalsam
.Also, to make sure you're using the correct password you can run the following command:
If running the previous commands yields the same value for both columns, you're using the correct password. If they aren't the same you'll need to either reset the password or delete the user grants and recreate the user account.
Make sure you're using the correct username, and not "me" as you posted in your question.