Mysql
root. 123
查询当前数据库编码:
show variables like 'char%';
修改某一个编码:
set character_set_results=utf8;
创建中文数据库:
CREATE DATABASE `shuiyue` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
补一个新的字段:
alter table autotestapi add hostip varchar(255);
- CREATE TABLE test (
- uname varchar(50) NOT NULL,
- updatetime timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
- ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
mysql> create table js(
id int(11) primary key not null auto_increment,
discription varchar(100) not null,
js_path varchar(100) not null);
时间戳默认值高低版本区别
高版本
create table autotestapi1(
id int(12) primary key not null auto_increment,
run_project varchar(100),
run_case varchar(100),
update_time timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
end_time varchar(100),
status int(12),
test_or_line int(12),
start_time timestamp NULL DEFAULT CURRENT_TIMESTAMP,
report_path varchar(255));
低版本
create table autotestapi1(
id int(12) primary key not null auto_increment,
run_project varchar(100),
run_case varchar(100),
update_time timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
end_time varchar(100),
status int(12),
test_or_line int(12),
start_time timestamp NULL ,
report_path varchar(255));