MySQL Change root password

Source: Internet
Author: User

    1. First stop the MySQL service
/etc/init.d/mysql stop

2. Then re-create a MySQL service with the Ignore Password Authentication mode

Return PID and other startup information after successful startup

[1] 3591Root@webserver:/Home/webmaster#121005 2: -: - [Note]Plugin'Federated'  isdisabled.121005 2: -: -Innodb:the InnoDB Memory Heap isDisabled121005 2: -: -Innodb:mutexes andRw_locks UseGCC Atomic builtins121005 2: -: -innodb:compressed tables UseZlib1.2.3.4 121005 2: -: -Innodb:initializing buffer pool, size=  -. 0M121005 2: -: -Innodb:completed initialization ofBuffer Pool121005 2: -: -Innodb:highest supportedfileFormat isBarracuda.121005 2: -: -Innodb:waiting forThe background threads toStart121005 2: -: -InnoDB:1.1.8StartedLogSequence Number 1595685 121005 2: -: - [Note]Mysqld:ready forconnections. Version:'5.5.24-0ubuntu0.12.04.1'Socket'/var/run/mysqld/mysqld.sock'Port0(Ubuntu)

3. Connect to the MySQL system library

4. After connecting to the MySQL library, directly modify the password of the root account to the new password ' 123456 '

Type'Help ;' or '\h'  forHelp. Type'\c'  toClear the Currentinput statement. mysql> Update User SetPassword=PASSWORD ('123456')where User='Root'; Query OK,3Rows Affected (0.00sec) Rows matched:3Changed:3Warnings:0MySQL>FLUSHPrivileges; MySQL>quit; Bye

5. Abort the MySQL service process

Kill 3591

6. Start the MySQL service normally and log in to the MySQL server with a new password

Service MySQL Start

MySQL Change root password

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.