[Mysql] Change the root password and create an account with the same permissions as root, mysqlroot

Source: Internet
Author: User
Tags mysql command line

[Mysql] Change the root password and create an account with the same permissions as root, mysqlroot

You may need to change the root password because it must work with the Mysql database password on the server. You cannot always use Ctrl + H to replace the server password of the network project for each update, otherwise, it may be replaced with other database-independent fields. This makes the project even worse.

In addition, in order to have an account with the same permissions as the root account to participate in the test and make some demos, you also need to create an account with the same permissions as the root account.

First, you must open the MySQL Command Line Client Command Line.



1. Modify the password of the root account during the original installation

Similarly, you can change the passwords of other accounts,

Enter the following statement in the command line:

UPDATE mysql. user SET password = PASSWORD ('new password') WHERE User = 'root'; flush privileges;


2. Create an account with the same permissions as root

Enter the following statement in the command line:

Create user 'account' @ '%' identified by 'Password'; grant all privileges on *. * TO 'account' @ '%' identified by 'Password' with grant option MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;



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.