MySQL changes the default root account password

Source: Internet
Author: User

  1. edit mysql profile: My.ini (in MySQL installation directory).
  2. Open the configuration file, add it to the last line of the file: Skip-grant-tables, and then save exit
    1. Span style= "color: #333333; font-family: "microsoft yahei", Microsoft ya Black, arial, song body, Sans-serif; Font-size:1rem; Font-style:normal; Font-weight:normal; Letter-spacing:normal; Orphans:2; text-align:justify; text-indent:0px; Text-transform:none; White-space:normal; Widows:2; word-spacing:0px; Float:none; Display:inline!important; Background-color: #ffffff "means to not start grant-tables
  3. when starting MySQL
  4. restart MySQL service: (in the command-line window, you need to add the MySQL bin path to the environment variable beforehand, or by restarting it in the service)
      1.  net stop mysql
      2.  net start MySQL
  5. set a new root password
    1. mysql-u root-p Direct Enter, no need to enter a password to enter the database . (Or you can enter the database without a password by hitting enter directly)
    2. Use MySQL at the command line (switch to system database)
    3. execute the following statement to modify the root user password:
        1. update user set Password=password (" 123456 ") where user= ' root '; (MySQL5.5 version below)
        2. update user set authentication_string=password (' 123456 ')  where  user= ' root '; (MySQL5.5 higher)
 

<wiz_tmp_tag id= "Wiz-table-range-border" contenteditable= "false" style= "Display:none;" >



From for notes (Wiz)



MySQL changes the default root account 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.