随笔分类 - Database / MySQL
摘要:DATE: DATETIME: TIMESTAMP: Fractional Seconds:
阅读全文
摘要:https://dev.mysql.com/doc/refman/8.0/en/fractional-seconds.html CREATE TABLE fractional (c1 TIME(3), c2 DATETIME(3), c3 TIMESTAMP(4));
阅读全文
摘要:https://dev.mysql.com/doc/refman/8.0/en/timestamp-initialization.html CREATE TABLE t1 ( ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMES
阅读全文
摘要:CREATE TABLE tr ( id INT, name VARCHAR(50), purchased DATE ) PARTITION BY RANGE( YEAR(purchased) ) ( PARTITION p0 VALUES LESS THAN (1990), PARTITION p
阅读全文
摘要:
阅读全文
摘要:行锁 变 表锁: Number 隐式转 String时, 索引所在列失效, 变表锁 String 隐式转 Number时, 索引所在列不失效, 仍为行锁 间隙锁
阅读全文
摘要:select current_date() from dual; select current_time() from dual; select current_timestamp() from dual; select date_add(now,interval 10 minute) from d
阅读全文
摘要:select abs(-5) from dual; select bin(10) from dual; # 转二进制 1010 select hex(100) from dual; select conv(number,from_base,to_base) select ceil(n) select
阅读全文
摘要:select charset(str); # 显示客户端字符集 select charset(field1) from table; # field1字符集 select charset(field2) from table; # field2字符集 concat(str1,str2,...); i
阅读全文
摘要:load data infile 'data.csv' into table project.tbl_data character set utf8mb4 fields terminated by ',' optionally enclosed '"' escaped by '"' lines te
阅读全文
摘要:CREATE TABLE vaunt ( id INTEGER PRIMARY KEY, NAME VARCHAR ( 55 ) NOT NULL, PASSWORD VARCHAR ( 55 ) NOT NULL, email VARCHAR ( 55 ), create_time TIMESTA
阅读全文
摘要:select concat('drop table ',table_name,';') from information_schema.tables where table_schema='employees' and table_name rlike '^d.*$' into outfile 'd
阅读全文
摘要:show status like 'innodb_row_lock%';select table_name,table_rows from information_schema.tables where table_schema='courier' order by table_rows desc;
阅读全文
摘要:设定字段默认值 alter table b alter id set default 0; 取消字段默认值 alter table b alter id drop default; 修改存储引擎 alter table b engine=myisam;
阅读全文
摘要:配置CA server(master上) /etc/pki/tls/openssl.cnf dir=/etc/pki/CA cd /etc/pki/CA touch index.txt echo 01 > serial (umask 066;openssl genrsa -out private/c
阅读全文
摘要:插件目录 默认目录 /usr/lib64/mysql/plugin
阅读全文
摘要:-s 依据什么排序al average lock timear average rows sentat average query timec countl lock timer rows sentt query time -t show top N queries -g grep: only co
阅读全文