0

I am new to MySQL. Today is my first day using it through XAMPP. I have managed to change my password using the code

mysqladmin -u root password

Suddenly I was denied access from XAMPP and from the MySQL Admin portal. I tried to reset the password immediately in the same window using the same command but I was given the error

mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'

I saw a number of related questions here on stackoverflow but they were all about phpMyAdmin password issues.

I would like to rest it to the default password and gain access to MySQL & XAMPP again. I have been going around in circles for an hour. Any help would be appreciated.

1 Answers1

0

maybe the root is not configured to localhost, if it is a new database, and can do this safely, you can try:

  1. change the my.cnf, set mysql skip-grant-tables
  2. restart mysql server, now you can visit the server with any account
  3. select data from mysql.user and get the rows that user='root' and get the info.

now: skip-grant-tables is an unsafe parameter in production env, change it back before you put the server online.