0

I deployed XAMPP on a remote server, after the installation was done, I set the new password to MySql.but when I tried to log into PHPMyAdmin, it said I have no access to MYSQL. phpmyadmin I don't know if was because I didn't have the right password or I just don't have the privilege. So I search for some approach to fix this.i add skip-grant-tables in my.cnf file, still, it doesn't work. And I modified the config.inc.php as I changed the password to a new password I just set. config.inc.php still, it didn't work. However, I can make it into MySql on Shell instead of PHPMyAdmin. mysql what can I do now?

Jacob Nelson
  • 2,370
  • 23
  • 35
  • Does this answer your question? [Access Denied for User 'root'@'localhost' (using password: YES) - No Privileges?](https://stackoverflow.com/questions/17975120/access-denied-for-user-rootlocalhost-using-password-yes-no-privileges) – BhAvik Gajjar Dec 02 '19 at 05:16
  • Your root user is saved as `root@%` or `root@localhost`? – FanoFN Dec 02 '19 at 06:32
  • With auth_type cookie, which you have in your config.inc.php (and it's also the phpMyAdmin default), you don't need to define a password in config.inc.php because you're prompted for one when logging in. Does your old password work for logging in? The error message suggests that you either didn't change the password successfully or to that you changed the password for a different account (as suggested by tcadidot0, since the host field `%` is different from host `localhost`). – Isaac Bennetch Jan 21 '20 at 23:47

1 Answers1

0

Use the instructions for resetting the root password - but instead of resetting the root password, we'll going to forcefully INSERT a record into the mysql.user table

In the init file, use this instead.

INSERT INTO mysql.user (Host, User, Password) VALUES ('%', 'root', password('YOURPASSWORD'));
GRANT ALL ON *.* TO 'root'@'%' WITH GRANT OPTION;
PHP Geek
  • 3,949
  • 1
  • 16
  • 32