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.
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