创建数据库
root没有设置密码
CREATE DATABASE cache-cloud DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
MySQL的表操作
- 添加字段
alter table `{table_name}` add {field_name} varchar(200) default NULL comment '字段注释';
- 删除字段
alter table `{table_name}` drop {field_name};
- 更改字段
alter table `{table_name}` change old_field_name new_field_name varchar(500) default NULL comment '字段注释';
用户操作
- 创建用户
create USER 'lenn'@'localhost' IDENTIFIED WITH mysql_native_password BY 'xxxx';
- 授权
GRANT all ON cache_cloud.* TO 'lenn'@'localhost';
- 删除用户
drop user 'lenn'@'localhost';