1. Select Data Sheet
The statements are as follows: UseMySQL;
2. Add a connection user account to the users table in MySQL:
Instead of adding a user record directly using the INSERT statement, using Insert may appear:
Error 1364 (HY000): Field ' ssl_cipher ' doesn ' t has a default value error. However, the early MySQL version of the author did not appear this error, because the day edge has been directly modified user table or directly using the INSERT statement, and later upgrade MySQL to 5.1, found that this error may occur.
The GRANT statement is recommended for authorization with the following statement:
GRANT USAGE on *. username ' @ ' localhost ' identified by ' password ' with GRANT OPTION;
The sentence:
"username" is replaced with the username that will be authorized, such as CLIENTUSR;
"Password" is replaced with the password set by CLIENTUSR;
3. Access to Data sheet authorization
After the account has been created, the data table authorization is given to the common user above, and the connection user default permissions added in step 3 are "N", the account must be authorized in the DB table to access the dedicated database , and of course the superuser does not say.
Use the following statement:
GRANT Select,insert,update,delete,create,drop on tablename.* to ' username ' @ ' localhost ' identified by ' password ';
The permissions in this statement are determined according to actual needs:
"TableName" replaced with the table name of the data tables authorized for access
"Username" is the Step 2 authorized user name
"Password" is the setup password for step 2 authorized users
This gives the user a select, INSERT, UPDATE, DELETE, Careate, and drop permissions on a data table.
4, the effective authorization, the creation is complete
A word can: FLUSH privileges;
This article is from "This is My Freedom" blog, please be sure to keep this source http://sasyun.blog.51cto.com/8709212/1530827