mysql初始化数据库建表脚本

set names utf8;

set global validate_password.policy=LOW;
set global validate_password.length=6;
CREATE DATABASE If Not Exists ai_teaching Character Set UTF8;
CREATE USER 'ai'@'localhost' IDENTIFIED BY 'shixun';
GRANT all ON ai_teaching.* TO 'ai'@'localhost';
GRANT all ON ai_teaching.* TO 'root'@'%';

use ai_teaching;

create table IF NOT EXISTS `tbl_user_images`(
`id` INT UNSIGNED AUTO_INCREMENT,
`user_id` VARCHAR(40) NOT NULL,
`label_name` VARCHAR(255) NOT NULL,
`image` LONGBLOB NOT NULL,
`vector` VARCHAR(4000) NOT NULL,
PRIMARY KEY (`id`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;

猜你喜欢

转载自www.cnblogs.com/yinliang/p/11784918.html