随笔分类 -  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_ 阅读全文
posted @ 2024-08-22 16:09 chenzechao 阅读(156) 评论(0) 推荐(0) 编辑
摘要:select t3.* ,case when day_start > month_current and day_end < month_last then TIMESTAMPDIFF(DAY,day_start,day_end) + 1 -- '中间,结束时间 - 开始时间' when day_s 阅读全文
posted @ 2024-07-18 17:07 chenzechao 阅读(15) 评论(0) 推荐(0) 编辑
摘要:-- 第一个会话执行 drop table if exists test1; create table test1( id int not null ,name int ,primary key(id) ,unique key(name) ) engine=innodb ; begin; inser 阅读全文
posted @ 2022-10-17 17:53 chenzechao 阅读(943) 评论(0) 推荐(0) 编辑
摘要:select replace(convert(info using ascii),"?","") as info_fix ,convert(info using ascii) as info_fix2 ,substring_index(substring_index(INFO,'\n',2),'\n 阅读全文
posted @ 2022-09-13 22:44 chenzechao 阅读(230) 评论(0) 推荐(0) 编辑
摘要:Check binlog status -- https://github.com/alibaba/canal/wiki/AdminGuide show variables like 'log_bin'; show variables like 'binlog_format'; MySQL Binl 阅读全文
posted @ 2022-01-24 15:19 chenzechao 阅读(5036) 评论(0) 推荐(1) 编辑
摘要: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 阅读全文
posted @ 2021-12-24 10:47 chenzechao 阅读(34) 评论(0) 推荐(0) 编辑
该文被密码保护。
posted @ 2021-12-20 15:38 chenzechao 阅读(0) 评论(0) 推荐(0) 编辑
摘要:### 源数据库信息 db_url_source="-h111.111.111.111 -uuser_name -ppasspord" db_name_source="db_name_source" ### 目录数据库信息 db_url_target="-h111.111.111.111 -uuse 阅读全文
posted @ 2021-11-25 15:50 chenzechao 阅读(55) 评论(0) 推荐(0) 编辑
摘要:问题原因: 1 过去mysql密码认证插件是 mysql_native_passwd 2 mysql8.0版本以后密码认证插件使用的是caching_sha2_password 办法: 修改密码认证方式,改回mysql_native_passwd插件 解决: 1 vim /etc/my.cnf添加如 阅读全文
posted @ 2021-11-19 16:18 chenzechao 阅读(294) 评论(0) 推荐(0) 编辑
摘要:date_add和date_sub 语法为:date_add(date,interval expr type)、date_sub(date,interval expr type) 其中常用的type的类型有:second、minute、hour、day、month、year等 -- 获取日期 202 阅读全文
posted @ 2021-08-20 11:08 chenzechao 阅读(200) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2021-05-18 11:29 chenzechao 阅读(172) 评论(0) 推荐(0) 编辑
摘要:### mysql8通过jdbc连接,时间快14个小时 # 在my.conf文件中添加以下参数 default-time-zone = '+08:00' https://www.dtmao.cc/news_show_287644.shtml https://www.blackchen.site/20 阅读全文
posted @ 2021-03-17 17:17 chenzechao 阅读(169) 评论(0) 推荐(0) 编辑
摘要:### ADB测试 ### RDS测试 https://blog.csdn.net/marising/article/details/105974151 阅读全文
posted @ 2021-03-03 17:26 chenzechao 阅读(50) 评论(0) 推荐(0) 编辑
摘要: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 阅读全文
posted @ 2021-02-02 17:30 chenzechao 阅读(103) 评论(0) 推荐(0) 编辑
摘要:### 1. 报错:"PDOException: PDO::__construct(): The server requested authentication method unknown to the client [caching_sha2_password] 问题原因: 1 过去mysql密 阅读全文
posted @ 2021-01-22 11:29 chenzechao 阅读(1164) 评论(0) 推荐(0) 编辑
摘要:-- 检查表的元数据是否有异常 -- 判断逻辑为如果表有记录,但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 阅读全文
posted @ 2020-12-25 15:41 chenzechao 阅读(153) 评论(0) 推荐(0) 编辑
摘要:MYSQL压缩表测试 1. 创建表 -- 压缩表 SET GLOBAL innodb_file_per_table=1; SET GLOBAL innodb_file_format=Barracuda; CREATE TABLE compress_01 ( id varchar(36) PRIMAR 阅读全文
posted @ 2020-12-10 17:21 chenzechao 阅读(296) 评论(0) 推荐(0) 编辑
摘要:mysql> select * from INNODB_LOCKS; + + + + + + + + + + + | lock_id | lock_trx_id | lock_mode | lock_type | lock_table | lock_index | lock_space | lock 阅读全文
posted @ 2020-09-07 16:20 chenzechao 阅读(314) 评论(0) 推荐(0) 编辑
摘要:?characterEncoding=UTF-8 &allowMultiQueries=true &autoReconnect=true &pinGlobalTxToPhysicalConnection=true ?user=root &password= &useUnicode=true &cha 阅读全文
posted @ 2020-07-29 14:53 chenzechao 阅读(1438) 评论(0) 推荐(0) 编辑
摘要:2020-07-24 11:23:12.145 [0-0-0-writer] WARN CommonRdbmsWriter$Task - 回滚此次写入, 采用每次写入一行方式提交. 因为:[9001, 2020072411231201011105516903453695186] unsupport 阅读全文
posted @ 2020-07-24 17:13 chenzechao 阅读(2045) 评论(2) 推荐(0) 编辑

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