mysql创建数据库和用户 并授权

使用root用户登录后

create database fzh;--创建数据库



CREATE USER 'client4451'@'localhost' IDENTIFIED BY 'fazhihongttyu665';--创建用户


grant all on fzh.* to client4451@localhost;--授权


DROP TABLE IF EXISTS `fzh_goods`;
CREATE TABLE `fzh_goods` (
`goods_id`  varchar(40) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,
`name`  varchar(50) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '商品名称' ,
`price`  double(10,4) NULL DEFAULT NULL COMMENT '价格' ,
`detail`  varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '详细描述' ,
`pic_url`  varchar(200) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
`status`  varchar(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL ,
PRIMARY KEY (`goods_id`)
)
ENGINE=InnoDB
DEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci
;

你可能感兴趣的:(数据库)