Forget solution MySQL / MariaDB root password

MySQL / MariaDB root password forget, do not know how to do change, here are the steps to modify the root password.

Type 'help;' or '/h' for help. Type '/c' to clear the current input statement.

MariaDB [(none)]> SET password = password ( '123');
ERROR 1290 (HY000): with running of The MariaDB Server IS The Grant---skip-Option Tables SO IT CAN Not Execute the this Statement
MariaDB [(none)] > use MySQL
Database changed
MariaDB [MySQL]> Update User SET password = password ( 'the root') WHERE User = 'the root' and Host = 'localhost';
Query the OK, 0 rows affected (0.00 sec)
the rows Matched:. 1 the changed: 0 Warnings: 0
in this case, due to the use --skip-grant-tables option is enabled, use the "set password" command to change the password failed, straight
change passwords after a successful password field then update the user table.

(4) permission to refresh the table so that the certification authority revalidated:
MariaDB [MySQL]> flush privileges;
Query the OK, 0 rows affected (0.00 sec)

Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '/h' for help. Type '/c' to clear the current input statement.

At this point the password changed successfully

Guess you like

Origin www.linuxidc.com/Linux/2019-08/160126.htm