Experiences of mysql remote data connection bitsCN.com
Experiences of mysql remote data connection
[SQL]
1. add a user
[SQL]
Mysql> insert into mysql. user (Host, User, Password) values ("localhost", "lionbule", password ("hello1234 "));
Mysql> flush privileges;
2. modify the user password www.bitsCN.com
[SQL]
Mysql> update mysql. user set password = password ('New password') where User = "lionbule" and Host = "localhost ";
Mysql> flush privileges;
3. delete a user
[SQL]
Mysql> delete from user WHERE User = "lionbule" and Host = "localhost ";
Mysql> flush privileges;
4. Permission Assignment
4.1. grant usage
Grant permission on database. * to username @ 'login host' identified by 'password'
[SQL]
Permission:
Common Summary: ALL/ALTER/CREATE/DROP/SELECT/UPDATE/DELETE
Database:
*. * Indicates all tables in all databases.
Test. * indicates all tables in the test database.
Test. test_table indicates the test_table table of the test database.
User name:
Mysql account name
Login host: www.bitsCN.com
Client ip addresses allowed to log on to mysql server
'%' Indicates all ip addresses
'Localhost' indicates the local machine
'1970. 168.10.2 'specific IP address
Password:
Logon password for the account
Example:
[SQL]
Mysql> grant all on test. * to lionbule @ '%' identified by 'hello1234 ';
Mysql> flush privileges;
BitsCN.com