【mysql】学习笔记

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);



  1. CREATE TABLE test (   
  2. uname varchar(50) NOT NULL,   
  3. updatetime timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP   
  4. ) 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));

连表查询

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值