MySQL Client Management

mysql -P3306 -h localhost -u root -p

Namely: the server port username password (I'll let you do not enter with this parameter indicates the password, enter the password after opening the client, can also be entered here directly in the back, open the client without entering a password)

Some basic operations:
Create a database: CREATE DATABASE name

Create a user:

grant 操作权限 on 数据库.表 to '用户名'@'登陆权限' identified by '密码';
# 例子:
grant all on abc.* to 'abc'@'%' identified by '123456';

Operating authority: to control what users can use the command with a comma between multiple permissions, if you want to allow full, then it is set to ALL.
Database table: If you want all databases, or all the tables, can be set .

Landing permission:
| rights | Description |
| --- | --- |
| localhost | only network access |
|% | all network access |
| IP | specify an IP access (you can do with wildcards%, such as this .: 192.168.0%) |

After each user remember about the implementation of this configuration, the configuration allows rapid entry into force:

flush privileges;

Display database list:

show databases;

Select Database

use information_schema;

Display database tables:

show tables;

Guess you like

Origin www.cnblogs.com/DragonStart/p/12462345.html