MARIADB Reset Password

Source: Internet
Author: User
Tags reset

Depressed, Ubuntu in the command line MARIADB, the installation process does not appear the input root user interface, installed MARIADB, do not know the root user password, logged in as root to report the following error:

david@david-pc:~$ mysql-uroot-p
Enter Password:
ERROR 1045 (28000): Access denied for user ' root ' @ ' localhost ' (using Password:yes)


Steps to resolve:

1.

sudo identity open/etc/mysql/my.cnf
Add the following code under the "Mysqld" node:

Skip-grant-tables #忽略密码授权


2.

Kill the MySQL process, restart mariadb, then directly mysql-uroot-p, without a password to log in to MySQL.

david@david-pc:/etc$ mysql-uroot-p
Enter Password:
Welcome to the MariaDB Monitor. Commands End With; or \g.
Your MariaDB Connection ID is 9
Server version:10.0.28-mariadb-1 Debian Unstable


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


Type ' help ', ' or ' \h ' for help. Type ' \c ' to clear the current input statement.


MariaDB [(None)]>


3.

After logging in, change the root password:

Use MySQL;

Update Mysql.user set Password=password (' Your_password ') where user= ' root ';


4.

sudo identity open/etc/mysql/my.cnf
Under the "mysqld" node, comment the following code:

#skip-grant-tables


5.

Restart MARIADB

sudo service MySQL restart

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.