CREATE DATABASE pic_manager /*创建数据库 pic_manager */
GRANT select,insert,delete,update ON pic_manager.* to neuq IDENTIFIED by '123'/*创建用户 neuq ,密码 123 ;把 pic_manager的所有权限 分配给用户neuq */
use pic_manager /* 切换到pic_manager */
CREATE TABLE admin(user_name VARCHAR(20) primary key,password varchar(20)) /*创建admin表*/
insert into admin(user_name,password) values('admin','admin') /*往 admin 表插入一条数据*/
CREATE TABLE users(user_id int auto_increment primary key,user_name VARCHAR(20),password varchar(20),name varchar(20),sex varchar(6),age varchar(20),tel varchar(30),address varchar(40),email varchar(30))
/*创建 users表*/
CREATE TABLE comments(comment_id int auto_increment primary key,picture_id int,content varchar(200),comment_time DATETIME,user_name VARCHAR(30))
/*创建 comments表*/
CREATE TABLE pictures(picture_id int auto_increment primary key,picture_title varchar(20),picture_name longblob,upload_time DATETIME,user_name VARCHAR(20))
/*创建 pictures表 */
/*上面的字段约束条件 ,自己会看吧!,w3c SQL自己查*/
grant all on *.* to scott@localhost identified by 'tiger'
use mydata
create table jchatuser (
uid bigint primary key auto_increment,
name varchar(30) binary,
ip varchar(30),
isLogin int,
loginDate datetime,
password varchar(30),
sex varchar(10),
head int
)
create table jchat (
id bigint primary key auto_increment,
name varchar(100),
cont mediumtext,
pdate datetime,
color varchar(10) default '#d9dbe9'
)
insert into jchatuser values(null,'test','127.0.0.1',1,now(),null,'boy',3)
insert into jchat values(null,'test','testtesttesttest',now(),null)
insert into jchat values(null,'test','testtesttesttest',now(),null)
insert into jchat values(null,'test','testtesttesttest',now(),null)
insert into jchat values(null,'test','testtesttesttest',now(),null)
insert into jchat values(null,'test','testtesttesttest',now(),null)
需要翻译的语句是这个
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)