How does Linux VPS modify the MySQL root Password?

Source: Internet
Author: User
Tags vps

Vim/etc/my. cnf add skip-grant-tables
/Etc/init. d/mysqld restart
Mysql
Use mysql
Update user set password = password ("XMY_vI105VxV") where user = "root ";
Flush privileges;
Exit
/Etc/init. d/mysqld restart

Win is to modify my. ini, and the same Restart service takes effect.

1. First open the/etc/my. cnf file and add skip-grant-tables in [mysqld ].
1


2. Save and restart mysql/etc/init. d/mysqld restart
II



3. log on to mysql directly without a password
3.




4. Run the command to fix the root password of mysql.



5. Modify/etc/my. cnf again. Delete the skip-grant-tables under [mysqld] and restart mysql.
V.



The first command modifies the my. conf or my. ini (win)
The second command is to log on to mysql (you can log on directly without restarting)
The third command is to exit mysql.
The fourth command is to restart apache.
The Fifth Command is to log on to mysql and report an error.
The sixth command is to log on to mysql with the modified password.

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.