标签:MySQL
1.MySQL创建db,删除db命令create database db;
drop database db;
整型:tinyint,smallint,mediumint,int,bigint
浮点型:float(m,d),double(m,d),decimal(m,d)
字符串类型:char(n),varchar(n),tinytext,text,mediumtext,longtext
日期和时间类型:date,time,datetime,timestamp,year
枚举类型:enum(‘member1‘,‘member‘,...)
参考:https://blog.csdn.net/francis_c/article/details/54982164
CREATE TABLE `tb_name` (
`id` int NOT NULL AUTO_INCREMENT,
`column1` xxx,
`column2` xxx,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE tb_name
开头
ENGINE=InnoDB DEFAULT CHARSET=utf8; 结尾
insert into tb_name () values ();
update tb_name set xxx=‘‘ where xxxx=‘‘;
delete from tb_name where xxxx=‘‘;
show processlist;
kill Id 杀死 杀死前要确认
desc tb_name;
show create table tb_name;
%
GRANT ALL PRIVILEGES ON db
.* TO ‘user‘@‘%‘ identified by ‘123456‘;
不对
删除arch及data目录
执行scripts/mysql_install_db重新部署
数据库字符集尽量使用utf8 减少乱码
show variables like ‘%xx%‘;
标签:MySQL
原文地址:http://blog.51cto.com/10814168/2114798