MySQL Change root password

Source: Internet
Author: User

Tag:mysql   root    password    

    1. Find the MySQL startup profile
          windows The following is My.ini, Linux under the name MY.CNF, Linux below if there is no special directory specified, then my.cnf generally stored under the/etc/directory.
      2. Modify the MySQL configuration file
          Locate the [mysqld] line in the configuration file, save the file after adding skip-grant-tables below and exit.
      3. Restart the MySQL database
      4. Reset the root password for MySQL
          method One: Use "path/mysql-h hostname (your host's IP address)----root mysql" command login Record MySQL, Run command change Password:

                          use MySQL;
                        Update user set Pass Word=password (' new password ') where user= ' root ';
                        flush privileges;
          Method Two: Use "path/mysqladmin-h hostname-u rootpassword ' new password '" To reset the root password directly.
      5. Modify the MySQL configuration file again
          Delete the skip-grant-tables that is added in step 2nd.
      6. Restart the MySQL database again


MySQL change root 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.