1, create a user: CREATE USER 'username' @ 'host' IDENTIFIED BY 'password';
username: User name;
host: Specifies which may be registered in the host machine can be set localhost,% pass with all remote hosts;
password: user login password;
2、授权:GRANT ALL PRIVILEGES ON *.* TO ‘username’@‘%’ IDENTIFIED BY 'password’;
Format: grant permission on the name of the database table name to log in the user @ host identified by "user password";
* * On behalf of ownership;
Access is behind @ MySQL client IP address (or host name)% on behalf of any client, if fill in localhost for the local access (that the user can not remotely access the mysql database a).
3, the refresh permissions: FLUSH PRIVILEGES;