# 连接数据库
mysql -u user_name -p;
# 创建数据库
create database db_name;
# 选择数据库
use db_name;
# 显示数据库
show databases;
# 创建用户
create use user_name@localhost identify by ‘password‘;
# 用户权限
grant all privileges on db_name.* on username@localhost identify by ‘password‘;
# 查看用户表
select user from user;
# 查看表名
show tables;
# 查看表字段
show column from table_name;
# 查看表索引
show index from table_name;
原文:https://www.cnblogs.com/stupid-vincent/p/9389787.html