MYSQL root password modification command summary _ MySQL

Source: Internet
Author: User
MYSQL root password modification command summary bitsCN.com 1. how can I change the root administrator password of mysql at the win2K command prompt?

> Mysql-u root-p
Enter password :******
Mysql> use mysql;
Mysql> update user set password = password ('New _ password') where user = 'root ';

In this way, you can directly change the password. If you can log on to MySQL under CMD, add "C:/Program Files/MySQL Server 5.0/bin" to the PATH of the Windows environment variable; "(change to your own installation path.

II. MYSQL root password command

Switch to the mysql 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 mysqlbitsCN.com

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.