随笔分类 -  Mysql

摘要:在容器中初始化登入密码 root@4a7d7a1851c6:/# mysql_secure_installation Securing the MySQL server deployment. Enter password for user root: VALIDATE PASSWORD PLUGI 阅读全文
posted @ 2025-08-12 17:19 gkhost 阅读(22) 评论(0) 推荐(0)
摘要:以下给出 MySQL 主备(主从)架构 中常用、与“只读”相关的全局变量 的查询方式及含义,方便你快速确认主库、备库各自的只读配置。 1. 查看当前实例只读相关参数 sql代码 SHOW GLOBAL VARIABLES WHERE Variable_name IN ( 'read_only', ' 阅读全文
posted @ 2025-08-12 16:59 gkhost 阅读(17) 评论(0) 推荐(0)
摘要:mysql 主从数据同步失败手动同步数据的方法 进入master执行 1、锁表 flush tables with read lock; 2、导出备份数据 mysqldump -u root -p test1 > /tmp/mysql.sql 3、查看主库状态记录偏移量position的值 show 阅读全文
posted @ 2024-12-05 10:50 gkhost 阅读(69) 评论(0) 推荐(0)
摘要:一、Gtid简介 GTID transactions are identified by a global transaction identifier (GTID) in the form UUID:NUMBER. Every GTID transaction in a log is always 阅读全文
posted @ 2024-12-05 10:48 gkhost 阅读(320) 评论(0) 推荐(0)
摘要:delimiter $$ CREATE PROCEDURE i_employees_ptarc (IN row_num INT) BEGIN DECLARE i INT DEFAULT 0 ; WHILE i < row_num DO INSERT INTO employees_ptarc (v_i 阅读全文
posted @ 2024-05-08 19:46 gkhost 阅读(46) 评论(0) 推荐(0)