MySQL Command mode modify MySQL root password note

Source: Internet
Author: User

The process of modifying the MySQL password is as follows

Baidu search an article to see the use of

Format: Mysqladmin-u username-P Old password password new password

I look at the operation when modified

Enter Password:

Welcome to the MySQL Monitor. Commands End With; or G.

Your MySQL Connection ID is 10

Server Version:5.5.27-log MySQL Community Server (GPL)

Copyright (c), the Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark the Oracle Corporation and/or its

Affiliates. Names may trademarks of their respective

Owners.

Type ' help, ' or ' h ' for help. Type ' C ' to clear the current input statement.

mysql> mysqladmin-u root Password The password I want to set

->

->;

Error 1064 (42000): You have a error in your SQL syntax; Check the manual that

Corresponds to your MySQL server version for the right syntax to use near ' MySQL

admin-u root password The password I want to set ' at line 1

Mysql> mysqladmin-u Root-password I want to set the password

->;

Error 1064 (42000): You have a error in your SQL syntax; Check the manual that

Corresponds to your MySQL server version for the right syntax to use near ' MySQL

Admin-u Root-password I want to set the password ' at line 1

The last small series used mysqladmin-u Root-password I want to set the password can not be fixed, suddenly thought of directly update the table can.

mysql> Update Mysql.user Set Password=password (' I want to set the password ') where user = ' root

';

Query OK, 3 rows affected (0.05 sec)

Rows Matched:3 Changed:3 warnings:0

mysql> flush Privileges;

Query OK, 0 rows affected (0.01 sec)

Mysql>

Okay, that's it. Oh, although the process is not complex and not simple.

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.