Linux MySQL password Modification

Source: Internet
Author: User

Linux MySQL password change 1) If you have not forgotten the password, you can use UPDATE to directly edit the user table to change the password: Enter the database mysql-u rootmysql> use mysql; mysql> UPDATE user SET Password = PASSWORD ('newpass') WHERE user = 'root'; mysql> flush privileges; or/etc/init. d/mysql stop/etc/init. d/mysql start 2) If you have forgotten the password: #/etc/init. d/mysql stop 1. End the currently running mysql process. #/Usr/bin/mysqld_safe -- skip-grant-tables 2. Run in mysql security mode and skip permission verification. # Mysql-u root 3. restart a terminal to log on to mysql as the root user. Mysql> use mysql; 4. Modify the root user password. Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with-A Database changedmysql> update user set Password = PASSWORD ('root ') where User = 'root'; Query OK, 3 rows affected (0.00 sec) Rows matched: 3 Changed: 3 Warnings: 0 mysql> exit #/etc/init. d/mysql restart 5. End mysql security mode and run mysql in normal mode. Mysql> update mysql. user set password = PASSWORD ('new password') where User = 'root'; 6. Try your new password mysql> flush privileges; mysql> quit

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.