mysql

mysql学习笔记

数据库操作命令

# 连接数据库
mysql -u user_name -p;
# 创建数据库
create database db_name;
# 选择数据库
use db_name;
# 显示数据库
show databases;

mysql管理命令

# 创建用户
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;

执行SQL文件

source D:create_table.sql;
原文地址:https://www.cnblogs.com/stupid-vincent/p/9389787.html