Сб. Июл 13th, 2024

The preceding sections provide password-resetting instructions for Windows and Unix systems. Alternatively, on any platform, you can set the new password using the mysql client (but this approach is less secure):

Stop mysqld and restart it with the —skip-grant-tables option. This enables anyone to connect without a password and with all privileges.

Connect to the mysqld server with this command:

shell> mysql
Issue the following statements in the mysql client. Replace the password with the password that you want to use.

mysql> UPDATE mysql.user SET Password=PASSWORD(‘MyNewPass’)
-> WHERE User=’root’;
The FLUSH statement tells the server to reload the grant tables into memory so that it notices the password change.

You should now be able to connect to the MySQL server as root using the new password. Stop the server and restart it normally (without the —skip-grant-tables option).


Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *

Анти-спам: выполните заданиеWordPress CAPTCHA