Reset Password after Linux MariaDB forgotten password

Source: Internet
Author: User

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...
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
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
    • 1
    • 2
    • 1
    • 2
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              
    • 1
    • 2
    • 3
    • 4
    • 1
    • 2
    • 3
    • 4

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.