Reset Password after Linux MariaDB forgotten password
MariaDB is a branch database of MySQL. The approach is the same as MySQL.
Modify the MySQL configuration file
Append the configuration entry in [MYSQLD]:
[[email protected] ~]# vim /etc/my.cnf[[email protected] ~]# cat /etc/my.cnf...[mysqld]skip-grant-tables...
Restart related services
The example uses MariaDB to restart the service and see if it started successfully:
[root@node9 ~]# systemctl restart mariadb[root@node9 ~]# systemctl status mariadb
Login Database Change Password
[Root@node9 ~]# mysql-uroot-pmariadb [mysql]> update user set Password = Password ( ' 48EB1C1C770D4BBC ') where user = ' root '; ok, 4 rows affected (0.00 sec) rows matched: 4 changed: 4 warnings: 0
This way need to note password must be written in, or incomplete modification, the error message is as follows:
[[Email protected] ~]# mysql-uroot-pmariadb [mysql]> UPDATE user SET Password = ' 48eb1c1c770d4bbc ' WHERE user = ' root '; Query OK, 4 rows affected (0.00 sec) Rows matched: 4 Changed: 4 Warnings: 0... [[Email protected] ~] # Mysql-uroot-penter Password:error 1275 (HY000): Server is running in--secure-auth mode, but ' root ' @' localhost ' has a password in the old format; "The password to the new format...
Reset Password after Linux MariaDB forgotten password