Root password reset for 3.1-mysql

Source: Internet
Author: User

MySQL does not have a password by default

Mysql-uroot or MySQL to log in.

Set Password

Mysqladmin-uroot password ' hd792310 '

Login command

mysql-uroot-phd792310


If the password is forgotten, the password can be initialized

1.vim/etc/my.cnf

At the core configuration, insert a code

Skip-grant not authorized, can directly login

2. Restart MySQL /etc/init.d/mysqld Restart

You can log in directly to Mysql-uroot

3. After logging in, use a MySQL library

Use MySQL

4. Update a table, that is, change the root user password

Update user set Password=password (' hd792310 ') where user= ' root ';

5. In the configuration file, remove the skip-grant line of code.


Root password reset for 3.1-mysql

Related Article

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.