mysql INNODB 与MEM的区别
摘要:InnoDB: IOT MEM: HOT 不支持行锁,数据重启后清空,为防止主从不一致,在数据库重启之后,在binlog写入一行delete from tablename 建议内存临时表用MEM InnoDB 表的数据总是有序存放的,而内存表的数据就是按照写入顺序存放的; 当数据文件有空洞的时候,I
阅读全文
posted @
2021-01-21 23:48
InnoLeo
阅读(129)
推荐(0)
RHEL8 Haproxy的读写分离
摘要:接上篇做双主https://www.cnblogs.com/tingxin/p/14290434.html 下载安装HAProxy mkdir /HAProxy /usr/local/haproxy wget http://www.haproxy.org/download/2.3/src/hapro
阅读全文
posted @
2021-01-19 19:27
InnoLeo
阅读(224)
推荐(0)
MySQL8 Keepalived+双主
摘要:坑:用keepalived 时,双主或是主从的PORT是相同的,因为keepalived 不会转发PORT 1. 配置双主: 双机名 win89.inno.com win88.inno.com 准备账号 SET SQL_LOG_BIN=0; set password for 'root'@'loca
阅读全文
posted @
2021-01-17 22:00
InnoLeo
阅读(458)
推荐(0)
Last_SQL_Errno: 1050 Last_SQL_Error: Error 'Table 'events' already exists' on query. Default database: 'eygle'. Query: 'create table events
摘要:主从复制Last_SQL_Errno: 1050 mysql> show slave status\G *************************** 1. row *************************** Slave_IO_State: Waiting for master
阅读全文
posted @
2021-01-17 20:10
InnoLeo
阅读(632)
推荐(0)
[MY-011522] [Repl] Plugin group_replication reported: 'The member contains transactions not present in the group.
摘要:error: mysql> start group_replication; ERROR 3092 (HY000): The server is not configured properly to be an active member of the group. Please see more
阅读全文
posted @
2021-01-17 12:10
InnoLeo
阅读(898)
推荐(0)
MYSQL8 裸机搭主从
摘要:步骤很我简单 在主机上运行以下SQL SET SQL_LOG_BIN=0; ##关闭binlog grant all privileges on *.* to root@'localhost' with grant option; create user 'repl'@'192.168.68.89'
阅读全文
posted @
2021-01-15 21:10
InnoLeo
阅读(159)
推荐(0)
MY-011292 MY-011300 MY-013597 MY-011300
摘要:error message [ERROR] [MY-011292] [Server] Plugin mysqlx reported: 'Preparation of I/O interfaces failed, X Protocol won't be accessible' [ERROR] [MY-
阅读全文
posted @
2021-01-15 16:42
InnoLeo
阅读(2715)
推荐(0)
SQL leecode学习 连续出现的数字
摘要:试题来自力扣 https://leetcode-cn.com/problems/consecutive-numbers/ 1. 构造数据 create table logs (id int primary key ,num int); insert into logs values(1,1); in
阅读全文
posted @
2020-12-26 13:58
InnoLeo
阅读(168)
推荐(0)
mysql SQL更新执行过程
摘要:WAL: Write-Ahead Logging 先写日志,再写磁盘 redo log 是InnoDB所特有的, update test set c=c+1 where ID=4; 将redo log 写入拆成了两个步骤,prepare 和commitly这就是两阶段提交 innodb_flush_
阅读全文
posted @
2020-12-21 14:09
InnoLeo
阅读(181)
推荐(0)
mysql SQL 查询执行过程
摘要:连接器:负责跟客户端建立连接,获取权限,维持和管理连接,一个用户建立连接后,权限做出了变更,需要重建连接,新权限才生效 show variables like 'innodb_monitor_reset'; --可以在每次执行一个比较大的操作后,通过执行 mysql_reset_connection
阅读全文
posted @
2020-12-21 12:16
InnoLeo
阅读(523)
推荐(0)
mysql 的重要参数,监控需要
摘要:以下是个人整理的Mysql一些重要的参数,需要通过监视工具监视 show status like 'Threads_connected'; --变量的值是表示当前有多少个客户连接该mysql服务器,连接数是否过多,网络时候存在问题!特别是在pconnect的情况下:) show status lik
阅读全文
posted @
2020-12-09 23:21
InnoLeo
阅读(267)
推荐(0)
mysql explain 中的key_len 的长度计算
摘要:1 查看字体集 mysql> show variables like '%char%'; + + + | Variable_name | Value | + + + | character_set_client | utf8 | | character_set_connection | utf8 |
阅读全文
posted @
2020-12-09 22:56
InnoLeo
阅读(267)
推荐(0)
mysql 8.0.20优化器成本记录表
摘要:mysql> select * from engine_cost; + + + + + + + + | engine_name | device_type | cost_name | cost_value | last_update | comment | default_value | + + +
阅读全文
posted @
2020-12-09 21:49
InnoLeo
阅读(182)
推荐(0)
mysql8.0.20 二进制安装
摘要:关闭selinux sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config setenforce 0 修改系统限制参数 cat >> /etc/security/limits.conf << EOF # ###custom
阅读全文
posted @
2020-12-08 22:27
InnoLeo
阅读(369)
推荐(0)
mysql 权限相关信息
摘要:查看全局权限: select * from mysql.user 查看库级别权限: select * from mysql.db 查看表级别权限: select * from mysql.tables_priv 查看列级别权限: select * from mysql.columns_priv
阅读全文
posted @
2020-12-07 15:48
InnoLeo
阅读(88)
推荐(0)
mysql 统计信息记录
摘要:相关参数 计信息的持久化功能 系统级 innodb_stats_persistent = ON 表级- STATS_PERSISTENT = 1 统计信息的持久化优化自动计算 系统级--innodb_stats_auto_recalc 表级--STATS_AUTO_RECALC 持久化统计信息时包含
阅读全文
posted @
2020-12-06 08:00
InnoLeo
阅读(353)
推荐(0)
MYSQL MGR 单写 A new primary切换
摘要:在MGR下,当主节点关掉后,在其他节点可以看到哪个节点为是新的主节点 [root@win2 logs]# tail -n 10 alert_3306.log 2020-11-19T12:19:42.561360Z 4 [Note] Plugin group_replication reported:
阅读全文
posted @
2020-11-20 00:55
InnoLeo
阅读(213)
推荐(0)
MYSQL MGR 单写
摘要:1.MYSQL配置文件 [root@win1 3306]# cat my.cnf [client] default-character-set = uft8 port = 3306 socket = /data/3306/tmp/mysql.sock [mysql] prompt="\u@mysql
阅读全文
posted @
2020-11-20 00:16
InnoLeo
阅读(114)
推荐(0)
MySQL PXC 高可用集群搭建
摘要:1.准备环境 --用户用户组 groupadd mysql useradd -g mysql mysql --目录 mkdir -p /data/PXC/{data,redo,binlog,tmp,logs} chown -R mysql:mysql /data/PXC chmod -R 755 /
阅读全文
posted @
2020-11-18 23:02
InnoLeo
阅读(358)
推荐(0)
mydump 备份数据库
摘要:mysqldump 备份 $ mysqldump --login-path=d1 --all-databases > /data/all.sql Warning: A partial dump from a server that has GTIDs will by default include
阅读全文
posted @
2020-11-18 10:34
InnoLeo
阅读(343)
推荐(0)