MySQL Common operations

Source: Internet
Author: User

1. Import the database

1  Use database; 2 Source path / file name;

2. New user, "localhost" here, refers to the user can only log on locally, if you want to telnet, the "localhost" to "%", indicating that on any computer can log on. You can also specify that a machine can log on remotely.

1 mysql>insert into MySQL. User (Host,Uservalues("localhost", "Test", Password ("111111"));

3. Set User permissions

1 //@"%"indicates authorization to all non-local hosts, excluding localhost2 3 //Authorization to localhost: plus a grant All Privileges  onTestDB.*  toTest@localhostIdentified by '111111', you can. 4 5 //all permissions for TestDB6Mysql>Grant  All Privileges  onTestDB.*  toTest@localhostIdentified by '111111';7 8 //Partial permissions for TestDB9Mysql>Grant Select,Update  onTestDB.*  toTest@localhostIdentified by '111111';Ten  One //Test user has select for all databases,Delete,Update,Create,Droppermissions.  AMysql>Grant Select,Delete,Update,Create,Drop  on *.*  to[Email protected] "%"Identified by"111111"; -  - //Refresh System Permissions Table theMysql>FlushPrivileges;

4. modify the specified user password

1 mysql>update MySQL. User set Password=password (' new password 'whereUser=   and Host="localhost"; 2 3  MySQL>privileges;

5.

MySQL Common operations

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.