0

I have installed xampp on Windows and am using phpmyadmin to create a database. When I paste the link of my php file corresponding to the database onto the browser I get the following error:

Warning: mysqli_connect(): (HY000/1045): Access denied for user 'id2207666_aditijha20'@'localhost' (using password: YES) in C:\xampp\htdocs\Register2.php on line 3

I tried the 'Grant Permission' command in SQL but that didn't work either.

GRANT ALL PRIVILEGES ON id2207666_perfect_fit.* TO 'id2207666_aditijha20'@'localhost' WITH GRANT OPTION;

ERROR: #1044 - Access denied for user 'id2207666_aditijha20'@'%' to database 'id2207666_perfect_fit'

How do I fix this? Thanks in advance

Alex Tartan
  • 6,736
  • 10
  • 34
  • 45
Aditi Jha
  • 11
  • 1

1 Answers1

0

there's a difference between 'id2207666_aditijha20'@'%' and 'id2207666_aditijha20'@'localhost'

Issue your grant for the user that you're using to connect:

GRANT ALL PRIVILEGES ON id2207666_perfect_fit.* TO 'id2207666_aditijha20'@'%' WITH GRANT OPTION;

Also, you may need to flush privileges

Alex Tartan
  • 6,736
  • 10
  • 34
  • 45