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