摘要:查看连接 client list 身份认证 auth password 获取慢查询 ## 结果为查询ID、发生时间、运行时长和原命令 默认10毫秒,默认只保留最后的128条。单线程的模型下,一个请求占掉10毫秒是件大事情,注意设置和显示的单位为微秒,注意这个时间是不包含网络延迟的。 SLOWLOG
阅读全文
摘要:单节点安装 需要一个数据目录地址,一个日志文件地址,配置文件 ## 数据目录地址 --dapath= ## 日志文件 --logpath= ## 配置文件 --config=***.conf 下载 https://fastdl.mongodb.org/osx/mongodb-macos-x86_64
阅读全文
摘要:mongodump & mongorestore 单库备份 ## -o 输出目录 mongodump --host 127.0.0.1 --port 27032 -u xxx -p xxx --db test2 --oplog -o ./test2 全库备份 --oplog只能在副本集中使用,因为副
阅读全文
摘要:假设表结构 create table test(a int not null, b int not null, c int not null, primary key(a), unique key idx_b(b))Engine=InnoDB; select * from test where b
阅读全文
摘要:方式一:redis-dump 前置 安装redis-dump https://blog.csdn.net/zhanaolu4821/article/details/103684237 数据导出 ## -u uri ## -a 密码 ## -d database ## 导出所有库 /usr/local
阅读全文
摘要:注意事项 默认文件存放位置 可执行文件(如redis、redis-server、redis-sentinel、redis-cli):/usr/local/bin 库文件:/usr/local/lib 配置文件:/usr/local/etc 资源文件:/usr/local/share 版本大全 htt
阅读全文
摘要:背景: 在AWS Aurora上如果设置slow_query_time=0,抓取全量日志分析,会导致日志文件过大,限制CPU性能发挥。因此使用Performance_schema分析sql。 可根据需要的指标,在SQL语句上添加响应字段。 #!/bin/bash source /etc/profil
阅读全文
摘要:阿里云CLI(Alibaba Cloud Command Line Interface)是基于OpenAPI建立的通用命令行工具,您可以借助阿里云CLI实现与阿里云产品的交互,在Shell工具中管理您的阿里云产品。 安装 下载安装包:https://aliyuncli.alicdn.com/aliy
阅读全文
摘要:枚举字段的默认值条件导致不走索引 create table test_tb( `uid` bigint unsigned not null, `status` enum('A','B','C') NOT NULL DEFAULT 'A' KEY `idx_on_auid` (`uid`,`statu
阅读全文
摘要:对应Aurora版本aurora3.04.3 导致bug的MySQL的查询语句 select ... where .. in () -- in列表中如果有太多值会导致查询变慢,里面值越多,会导致慢的倍数越多,参考https://bugs.mysql.com/bug.php?id=107902 --
阅读全文