Removed WAMP user PHPMyadmin

By mistake one of my phpmyadmin users got deleted and then when opening phpmyadmin it gives an error

"# 1045 - Access denied for user 'root' @ 'localhost' (using password: YES)"

Please help how to recover this account with the same name and password, also I'm worried about my databases not opening. Will they be safe and recovered or lost?

+3


source to share


1 answer


Try the following:

Access denied for user 'root' @ 'localhost' (using password: YES)

  • service mysqld stop

Stopping mysqld: [OK]

  1. mysqld_safe --skip-grant-tables &

mysqld_safe Login to '/var/lib/mysql/mysqld.err'.

mysqld_safe Start the mysqld daemon with databases from / var / lib / mysql



  1. mysql -u root

  2. mysql> UPDATE mysql.user SET password=PASSWORD("new_password") WHERE User='root';

    mysql> grant all privileges on *.* to root@localhost identified by 'new_password' with grant option;

Query OK, 0 lines (0.00 sec)

mysql> flush privileges;

Query OK, 0 lines (0.00 sec)

  1. service mysqld restart

Now try to login using the new root password

+1


source







All Articles