随笔分类 -  Database / MySQL

摘要:DATE: DATETIME: TIMESTAMP: Fractional Seconds: 阅读全文
posted @ 2022-07-26 23:18 ascertain 阅读(21) 评论(0) 推荐(0) 编辑
摘要:https://dev.mysql.com/doc/refman/8.0/en/fractional-seconds.html CREATE TABLE fractional (c1 TIME(3), c2 DATETIME(3), c3 TIMESTAMP(4)); 阅读全文
posted @ 2022-07-26 22:28 ascertain 阅读(44) 评论(0) 推荐(0) 编辑
摘要:https://dev.mysql.com/doc/refman/8.0/en/timestamp-initialization.html CREATE TABLE t1 ( ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMES 阅读全文
posted @ 2022-07-26 22:20 ascertain 阅读(22) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-05-09 13:01 ascertain 阅读(23) 评论(0) 推荐(0) 编辑
摘要:CREATE TABLE tr ( id INT, name VARCHAR(50), purchased DATE ) PARTITION BY RANGE( YEAR(purchased) ) ( PARTITION p0 VALUES LESS THAN (1990), PARTITION p 阅读全文
posted @ 2022-05-07 15:32 ascertain 阅读(39) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-04-26 17:08 ascertain 阅读(24) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-04-23 12:39 ascertain 阅读(35) 评论(0) 推荐(0) 编辑
摘要:行锁 变 表锁: Number 隐式转 String时, 索引所在列失效, 变表锁 String 隐式转 Number时, 索引所在列不失效, 仍为行锁 间隙锁 阅读全文
posted @ 2022-04-19 21:03 ascertain 阅读(32) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2022-04-16 21:35 ascertain 阅读(376) 评论(0) 推荐(0) 编辑
摘要:select current_date() from dual; select current_time() from dual; select current_timestamp() from dual; select date_add(now,interval 10 minute) from d 阅读全文
posted @ 2022-04-05 15:03 ascertain 阅读(32) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2022-04-05 14:23 ascertain 阅读(31) 评论(0) 推荐(0) 编辑
摘要:select charset(str); # 显示客户端字符集 select charset(field1) from table; # field1字符集 select charset(field2) from table; # field2字符集 concat(str1,str2,...); i 阅读全文
posted @ 2022-04-05 14:09 ascertain 阅读(31) 评论(0) 推荐(0) 编辑
摘要:load data infile 'data.csv' into table project.tbl_data character set utf8mb4 fields terminated by ',' optionally enclosed '"' escaped by '"' lines te 阅读全文
posted @ 2022-02-16 11:43 ascertain 阅读(78) 评论(0) 推荐(0) 编辑
摘要:CREATE TABLE vaunt ( id INTEGER PRIMARY KEY, NAME VARCHAR ( 55 ) NOT NULL, PASSWORD VARCHAR ( 55 ) NOT NULL, email VARCHAR ( 55 ), create_time TIMESTA 阅读全文
posted @ 2021-05-18 11:12 ascertain 阅读(78) 评论(0) 推荐(0) 编辑
摘要:select concat('drop table ',table_name,';') from information_schema.tables where table_schema='employees' and table_name rlike '^d.*$' into outfile 'd 阅读全文
posted @ 2021-05-14 12:21 ascertain 阅读(187) 评论(0) 推荐(0) 编辑
摘要:show status like 'innodb_row_lock%';select table_name,table_rows from information_schema.tables where table_schema='courier' order by table_rows desc; 阅读全文
posted @ 2021-04-23 18:46 ascertain 阅读(64) 评论(0) 推荐(0) 编辑
摘要:设定字段默认值 alter table b alter id set default 0; 取消字段默认值 alter table b alter id drop default; 修改存储引擎 alter table b engine=myisam; 阅读全文
posted @ 2021-04-15 18:31 ascertain 阅读(67) 评论(0) 推荐(0) 编辑
摘要:配置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 阅读全文
posted @ 2021-04-15 18:07 ascertain 阅读(313) 评论(0) 推荐(0) 编辑
摘要:插件目录 默认目录 /usr/lib64/mysql/plugin 阅读全文
posted @ 2021-04-15 16:20 ascertain 阅读(49) 评论(0) 推荐(0) 编辑
摘要:-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 阅读全文
posted @ 2021-04-14 18:03 ascertain 阅读(71) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示