Mysqlroot password modification method

Source: Internet
Author: User
This is a method for modifying the password of the mysqlroot user in command mode. You can easily perform this operation by clicking the doscommand.

This is a method for modifying the password of the mysql root User in command mode. You can easily perform this operation by clicking the doscommand.

Switch to the installation directory under cmd
Example
D:/mysql/bin
Prerequisites: the mysql root Password is empty.
Enter mysql-u root mysql
Mysql> enter update user set password = password ('new password') where user = 'root ';
Echo
Query OK, 0 rows affected (0.00 sec)
Rows matched: 2 Changed: 0 Warnings: 0
Mysql> Status, enter flush privileges;
Echo
Query OK, 0 rows affected (0.00 sec)
Mysql> enter quit
Exit SQL

Note that a semicolon ";" must be added after each command ";"
Mysql started to execute this command
The second command updates the database of the mysql system that has been loaded into the memory.

Restart mysql.
Stop MYSQL
Net stop mysql
Start MYSQL
Net start mysql

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.