How did Linux get into MySQL for the first time? Troubleshoot login issues and password issues

Source: Internet
Author: User

For MySQL just installed in Linux, the initial user is root, this root is not the root of Linux, but the root of MySQL, and the initial password is not.


    1. Start MySQL First

Everyone starts up in a different way, always, when the result starts it

2 . log in to MySQL
The command to log in to MySQL is MySQL, MySQL uses the following syntax:
   mysql [- u username] [-h host] [-p[password]] [dbname]

First login, password is empty: mysql-u root to enter

3. Establish Root's initial password (there are several ways)

* Use the mysqladmin command to change the root user password

# mysqladmin–u root Password 54netseek//set MySQL admin operation user root password is 52netseek


* Change password with Set password:

Mysql> Set password for [email protected]=password (' 54netseek); Note that the function of the semicolon is to end

* Directly modify the root user password of the user table

mysql> use MySQL;

mysql> Update user Set Password=password (' 54netseek ') where user= ' root ';

mysql> flush Privileges;

In the above, I used the last one, therole of fluseprivileges is to prevent changes to the password after the next time can not log in, the newly modified content into memory.

4. Login after password change

mysql-uroot-p123 (assuming password is 123)

This article is from the "Bulajunjun" blog, make sure to keep this source http://5148737.blog.51cto.com/5138737/1538480

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.