随笔分类 -  Database

摘要: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 阅读(71) 评论(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 阅读(76) 评论(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 阅读(353) 评论(0) 推荐(0)
摘要:插件目录 默认目录 /usr/lib64/mysql/plugin 阅读全文
posted @ 2021-04-15 16:20 ascertain 阅读(62) 评论(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 阅读(80) 评论(0) 推荐(0)
摘要:Client: # https://dev.mysql.com/doc/refman/8.0/en/mysql-commands.html [client] pipe # 只能使用pipe方式连接 socket=verbatim # /tmp/mysql.sock pipe名字, 由server的s 阅读全文
posted @ 2021-04-12 14:52 ascertain 阅读(202) 评论(0) 推荐(0)
摘要:ProxySQL Admin The ProxySQL Admin (proxysql-admin) solution configures Percona XtraDB cluster nodes into ProxySQL. Please log ProxySQL Admin bug repor 阅读全文
posted @ 2021-04-06 15:27 ascertain 阅读(135) 评论(0) 推荐(0)
摘要:1 概述 1.1 MySQL MGR 1.1.1 MGR简介 MySQL Group Replication(简称MGR)是MySQL官方推出的一种基于paxos协议的状态机复制,实现了分布式下数据的最终一致性。MySQL组复制提供了高可用、高扩展、高可靠的MySQL集群解决方案。 1.1.2 MG 阅读全文
posted @ 2021-04-06 15:20 ascertain 阅读(987) 评论(0) 推荐(0)
摘要:关闭MySQL systemctl stop mysqld 强制进行数据字典升级 和 服务安装 rpm -ivh mysql-community* --nodeps --force 卸载旧版 rpm -qa|grep mysql|grep 8.0.21|xargs rpm -e 查看版本 阅读全文
posted @ 2021-04-01 18:36 ascertain 阅读(577) 评论(0) 推荐(0)
摘要:table_stype 为 enum类型取值 BASE TABLE VIEW SYSTEM VIEW 用法: 某个schema是否存在某个table select table_schema, table_name, table_type, table_rows from information_sc 阅读全文
posted @ 2021-04-01 17:38 ascertain 阅读(298) 评论(0) 推荐(0)
摘要:建表时,指定字段case sensitive CREATE TABLE tbl_b ( ui VARCHAR ( 30 ) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL, op VARCHAR ( 30 ) CHARACTER SET 阅读全文
posted @ 2021-04-01 14:24 ascertain 阅读(35) 评论(0) 推荐(0)
摘要:https://dev.mysql.com/doc/refman/8.0/en/miscellaneous-functions.html https://dev.mysql.com/doc/refman/8.0/en/built-in-function-reference.html left(str 阅读全文
posted @ 2021-03-29 10:22 ascertain 阅读(94) 评论(0) 推荐(0)
摘要:Rename database 重命名数据库 #!/bin/env bash echo -e "\e[5mthe program is designed to rename database!\e[0m" read -p 'the source database: ' src read -p 'th 阅读全文
posted @ 2021-03-26 14:20 ascertain 阅读(205) 评论(0) 推荐(0)
摘要:select table_name,table_type,engine from information_schema.tables where table_schema=`database_name` order by table_name desc; 阅读全文
posted @ 2021-03-16 17:52 ascertain 阅读(46) 评论(0) 推荐(0)
摘要:--init-command=name SQL command to execute when connecting to MySQL server可用于导入数据时,关闭二进制日志 select connection_id(); 阅读全文
posted @ 2021-01-19 18:00 ascertain 阅读(69) 评论(0) 推荐(0)
摘要:binlog=statement binlog是在事务提交时才进行fsync刷盘,刷盘操作耗费IO,statement只需要一条语句,而不是所有操作过的数据行可能造成主从不一致 阅读全文
posted @ 2021-01-19 17:58 ascertain 阅读(58) 评论(0) 推荐(0)
摘要:主从高延迟: 网络延迟 max_allowed_packet auto_increment_increment auto_increment_offset sync_binlog=1 innodb_flush_log_at_trx_commit 事务长时间没有提交 大表的DDL 复制错误 串行执行大 阅读全文
posted @ 2021-01-15 18:22 ascertain 阅读(151) 评论(0) 推荐(0)
摘要:caching_sha2_password 加密串 mysql_native_password加密串 阅读全文
posted @ 2021-01-14 16:50 ascertain 阅读(81) 评论(0) 推荐(0)
摘要:统计某一数据库中所有表的记录数 select table_name,table_rows from `information_schema`.tables where table_schema=`db_name`; sql_mode中含有only_full_group_by 且 没使用group b 阅读全文
posted @ 2021-01-13 18:11 ascertain 阅读(231) 评论(0) 推荐(0)
摘要:https://dev.mysql.com/doc/refman/8.0/en/optimizer-hints.html 一、 /* .... */ 在大部分语言中都一样是注释。这个之中的语句是不被执行的。 但MYSQL中 为了保持兼容,比如从mysqldump 导出的SQL语句能被其它数据库直接使 阅读全文
posted @ 2021-01-07 15:34 ascertain 阅读(574) 评论(0) 推荐(0)