Regaining access to lost MySQL password for PHPMyAdmin on WAMP

后端 未结 3 1767
北恋
北恋 2020-11-28 08:05

I changed the password for my \'root\'@\'localhost\' account in PHPMyAdmin and like (this person asking here) and locked myself out of PHPMyAdmin on my brow

3条回答
  •  生来不讨喜
    2020-11-28 08:21

    Previous answers didn't work for me, since MySQL Console keep me out after pressing intro. Try this:

    Create a file C:\wamp64\mysql-init.txt with this content:

    UPDATE mysql.user SET Password=PASSWORD('1234') WHERE User='root';
    FLUSH PRIVILEGES;
    

    This will reset password to 1234 for user root. Then, run the next command on Windows Command Line:

    C:\wamp64\bin\mysql\mysql5.7.21\bin\mysqld.exe wampmysqld --init-file=C:\\wamp64\\mysql-init.txt
    

    Change paths depending on where is installed WAMP on your file system.

    Finally, restart WAMP services.

提交回复
热议问题