随笔分类 - Mysql
摘要:select t1.tenantcode ,t1.custom_field_htid ,t1.custom_field_zcid ,unnest as zcid_item from ( select a.tenantcode ,a.custom_field_htid ,a.custom_field_
阅读全文
摘要:select t3.* ,case when day_start > month_current and day_end < month_last then TIMESTAMPDIFF(DAY,day_start,day_end) + 1 -- '中间,结束时间 - 开始时间' when day_s
阅读全文
摘要:-- 第一个会话执行 drop table if exists test1; create table test1( id int not null ,name int ,primary key(id) ,unique key(name) ) engine=innodb ; begin; inser
阅读全文
摘要:select replace(convert(info using ascii),"?","") as info_fix ,convert(info using ascii) as info_fix2 ,substring_index(substring_index(INFO,'\n',2),'\n
阅读全文
摘要:Check binlog status -- https://github.com/alibaba/canal/wiki/AdminGuide show variables like 'log_bin'; show variables like 'binlog_format'; MySQL Binl
阅读全文
摘要:create table tmp_demo_01 ( id int ,name varchar(127) ,age int ) ; create table tmp_demo_02 ( id int ,name varchar(127) ) ; insert into tmp_demo_01 sel
阅读全文
摘要:### 源数据库信息 db_url_source="-h111.111.111.111 -uuser_name -ppasspord" db_name_source="db_name_source" ### 目录数据库信息 db_url_target="-h111.111.111.111 -uuse
阅读全文
摘要:问题原因: 1 过去mysql密码认证插件是 mysql_native_passwd 2 mysql8.0版本以后密码认证插件使用的是caching_sha2_password 办法: 修改密码认证方式,改回mysql_native_passwd插件 解决: 1 vim /etc/my.cnf添加如
阅读全文
摘要:date_add和date_sub 语法为:date_add(date,interval expr type)、date_sub(date,interval expr type) 其中常用的type的类型有:second、minute、hour、day、month、year等 -- 获取日期 202
阅读全文
摘要:DELIMITER $ CREATE TRIGGER `dw_realtime_i_a` AFTER INSERT ON `dw_realtime` FOR EACH ROW begin replace into dw_realtime(id,etl_dt) select id ,DATE_FORM
阅读全文
摘要:### mysql8通过jdbc连接,时间快14个小时 # 在my.conf文件中添加以下参数 default-time-zone = '+08:00' https://www.dtmao.cc/news_show_287644.shtml https://www.blackchen.site/20
阅读全文
摘要:### ADB测试 ### RDS测试 https://blog.csdn.net/marising/article/details/105974151
阅读全文
摘要:key_len的长度计算公式: varchr(10)变长字段且允许NULL : 10*(Character Set:utf8=3,gbk=2,latin1=1)+1(NULL)+2(变长字段) varchr(10)变长字段且不允许NULL : 10*(Character Set:utf8=3,gbk
阅读全文
摘要:### 1. 报错:"PDOException: PDO::__construct(): The server requested authentication method unknown to the client [caching_sha2_password] 问题原因: 1 过去mysql密
阅读全文
摘要:-- 检查表的元数据是否有异常 -- 判断逻辑为如果表有记录,但table_rows为0则异常 select t2.table_name ,t1.cnt ,t2.table_rows ,case when t1.cnt = 10 and t2.table_rows = 0 then 1 else 0
阅读全文
摘要:MYSQL压缩表测试 1. 创建表 -- 压缩表 SET GLOBAL innodb_file_per_table=1; SET GLOBAL innodb_file_format=Barracuda; CREATE TABLE compress_01 ( id varchar(36) PRIMAR
阅读全文
摘要:mysql> select * from INNODB_LOCKS; + + + + + + + + + + + | lock_id | lock_trx_id | lock_mode | lock_type | lock_table | lock_index | lock_space | lock
阅读全文
摘要:?characterEncoding=UTF-8 &allowMultiQueries=true &autoReconnect=true &pinGlobalTxToPhysicalConnection=true ?user=root &password= &useUnicode=true &cha
阅读全文
摘要:2020-07-24 11:23:12.145 [0-0-0-writer] WARN CommonRdbmsWriter$Task - 回滚此次写入, 采用每次写入一行方式提交. 因为:[9001, 2020072411231201011105516903453695186] unsupport
阅读全文