常用sql备份

/ mysql / 0 条评论 / 592浏览
SELECT * FROM case_data WHERE api_msg_id=4913

409
6734
SELECT * FROM case_data WHERE case_id=3574
SELECT * FROM `case` WHERE id=7092

SELECT * FROM information_schema.INNODB_LOCKs; 当前出现的锁
SELECT * FROM information_schema.INNODB_LOCK_waits; 锁等待的对应关系
SELECT * FROM information_schema.innodb_trx  当前运行的所有事务
SELECT * FROM information_schema.processlist WHERE command NOT IN ('Sleep') ORDER BY TIME DESC

SHOW VARIABLES LIKE '%max_connection%';


SELECT * FROM `case_data` WHERE case_id= 8278
SELECT * FROM `case` WHERE id=6740


SELECT * FROM api_msg WHERE variable LIKE "%orderschedule.query.order.by.orderschedule%"

DELETE FROM elk_log_1 WHERE message LIKE "driverLicenceOcr error request%"
DELETE FROM elk_log_bug WHERE message LIKE "driverLicenceOcr error request%" AND bugId IS NULL


SELECT * FROM api_msg WHERE id=1977
SELECT * FROM case_data WHERE api_msg_id=18873
SELECT * FROM `case` WHERE `name`='我的车队-管理收款账号' id=7958

INSERT INTO api_msg
VALUES(4825,2,'查询预约单列表--入库单',NULL,3,'json','1',NULL,NULL,'POST','[]','湘K48891','{\n  \"page\": 1,\n  \"pageSize\": 15,\n  \"whId\": \"137\",\n  \"companyName\": \"\",\n  \"goodsName\": \"\",\n  \"type\": \"1\",\n  \"sources\": \"\",\n  \"plateNumber\": \"鄂ABS861\",\n  \"no\": \"\",\n  \"status\": \"\",\n  \"startTime\": \"\",\n  \"endTime\": \"\"\n}','[{\"key\": \"\", \"value\": \"\"}]','/miniwms-web/api/ap/selectListByPage','[{\"key\": \"no\", \"remark\": null, \"value\": \"content.data.list.0.no\"}, {\"key\": \"apPlanId\", \"remark\": null, \"value\": \"content.data.list.0.id\"}, {\"key\": \"waybillNo\", \"remark\": null, \"value\": \"content.data.list.0.waybillNo\"}, {\"key\": \"forwardName\", \"remark\": null, \"value\": \"content.data.list.0.forwardName\"}]','[{\"comparator\": \"contains\", \"key\": \"content.message\", \"value\": \"\\u6210\\u529f\"}]','[{\"key\":\"Authorization\",\"value\":\"eyJhbGciOiJIUzI1NiJ9.eyJpYXQiOjE2MzQ4OTk0ODYsInN1YiI6Indtc193ZWJfMTBiYzUwNGQ0NjBiNDcwODgwN2Q5NDcwMDgyM2M3NTYiLCJleHAiOjE2MzU1MDQyODZ9.peOR2eDLxLB17_E-9M1c_klD8_rXBMVP67vAs9uEYSk\"},{\"key\":null,\"value\":null}]',136,15,'2021-08-12 00:08:02','2022-02-15 15:43:58',17,NULL,NULL)


SELECT * FROM `case` WHERE `name` LIKE "%,%"


SELECT @@global.sql_mode

SELECT * FROM execution_queue WHERE state="执行中"

EXPLAIN SELECT machine FROM elk_log_1 WHERE moduleName="sijibao-company-*" GROUP BY machine HAVING COUNT(machine)>1
SELECT DISTINCT(machine) FROM elk_log_1 WHERE moduleName="sijibao-company-*" GROUP BY machine HAVING COUNT(machine)>1

SELECT DISTINCT(machine) FROM elk_log_1 a WHERE moduleName="sijibao-company-*" AND (SELECT COUNT(machine) FROM elk_log_1 WHERE machine = a.machine)