随笔分类 -  mysql

摘要:master 节点 my.cnf server-id=1 log-bin=mysql-bin binlog-do-db=repl #需要同步的数据库,如果没有本行表示同步所有的数据库 binlog-ignore-db=mysql 创建复制用户 CREATE USER 'repluser'@'192. 阅读全文
posted @ 2024-11-01 17:51 小吉猫 阅读(227) 评论(0) 推荐(0)
摘要:CREATE USER 语句 CREATE USER [IF NOT EXISTS] user [auth_option] [, user [auth_option]] ... DEFAULT ROLE role [, role ] ... [REQUIRE {NONE | tls_option [ 阅读全文
posted @ 2024-11-01 16:44 小吉猫 阅读(154) 评论(0) 推荐(0)
摘要:安装依赖 apt -y install libaio1t64 ln -sv /usr/lib/x86_64-linux-gnu/libaio.so.1t64.0.2 /usr/lib/x86_64-linux-gnu/libaio.so.1 创建用户 groupadd -g 28 -o -r mys 阅读全文
posted @ 2024-11-01 15:29 小吉猫 阅读(1370) 评论(0) 推荐(0)
摘要:安装插件 查看当前插件 mysql> SELECT PLUGIN_NAME, PLUGIN_STATUS FROM INFORMATION_SCHEMA.PLUGINS WHERE PLUGIN_NAME LIKE 'connection%'; Empty set (0.00 sec) 安装插件 方 阅读全文
posted @ 2023-04-10 12:35 小吉猫 阅读(341) 评论(0) 推荐(0)
摘要:docker-compose.yaml version: '3.9' services: mysql: image: mysql:8.0.32 container_name: mysql restart: always command: --default-authentication-plugin 阅读全文
posted @ 2023-04-07 17:28 小吉猫 阅读(306) 评论(0) 推荐(0)
摘要:服务器端启动配置 查看默认数据目录 # ls -l data/ total 122944 -rw-r 1 mysql mysql 56 Apr 4 17:21 auto.cnf -rw 1 mysql mysql 1676 Apr 4 17:21 ca-key.pem -rw-r--r-- 1 my 阅读全文
posted @ 2023-04-04 19:00 小吉猫 阅读(455) 评论(0) 推荐(0)
摘要:CREATE 命令格式 CREATE USER [IF NOT EXISTS] user [auth_option] [, user [auth_option]] ... [REQUIRE {NONE | tls_option [[AND] tls_option] ...}] [WITH resou 阅读全文
posted @ 2023-04-04 17:15 小吉猫 阅读(31) 评论(0) 推荐(0)
摘要:查看当前%util # iostat -k -d -x 1 2 Device r/s rkB/s rrqm/s %rrqm r_await rareq-sz w/s wkB/s wrqm/s %wrqm w_await wareq-sz d/s dkB/s drqm/s %drqm d_await 阅读全文
posted @ 2023-04-03 13:42 小吉猫 阅读(102) 评论(0) 推荐(0)
摘要:查看binlog MySQL [(none)]> show binary logs; + + + | Log_name | File_size | + + + | mysql-bin.000246 | 1073742039 | | mysql-bin.000247 | 1073742006 | | 阅读全文
posted @ 2023-03-01 15:13 小吉猫 阅读(31) 评论(0) 推荐(0)
摘要:环境说明 主机说明 宿主机:192.168.1.219 备份机:192.168.2.235 备份要求 宿主机可以免密登录备份机 备份机器提前创建备份目录 # ssh root@192.168.2.235 "mkdir -pv /data/mysql-backs" mkdir: created dir 阅读全文
posted @ 2023-01-13 19:35 小吉猫 阅读(1134) 评论(0) 推荐(0)
摘要:创建备份用户 mysql> CREATE USER 'bkpuser'@'localhost' IDENTIFIED BY 's3cret'; mysql> GRANT RELOAD, LOCK TABLES, PROCESS, REPLICATION CLIENT ON *.* TO 'bkpus 阅读全文
posted @ 2023-01-13 17:40 小吉猫 阅读(411) 评论(0) 推荐(0)
摘要:创建备份用户 mysql> CREATE USER 'bkpuser'@'localhost' IDENTIFIED BY 's3cret'; mysql> GRANT RELOAD, LOCK TABLES, PROCESS, REPLICATION CLIENT ON *.* TO 'bkpus 阅读全文
posted @ 2023-01-12 19:25 小吉猫 阅读(142) 评论(0) 推荐(0)
摘要:创建备份用户 mysql> CREATE USER 'bkpuser'@'localhost' IDENTIFIED BY 's3cret'; mysql> GRANT SELECT, RELOAD, LOCK TABLES, PROCESS, REPLICATION CLIENT ON *.* T 阅读全文
posted @ 2023-01-12 18:18 小吉猫 阅读(86) 评论(0) 推荐(0)
摘要:sql_mode模式 sql model 常用来解决下面几类问题(1) 通过设置sql mode, 可以完成不同严格程度的数据校验,有效地保障数据准备性。(2) 通过设置sql model 为宽松模式,来保证大多数sql符合标准的sql语法,这样应用在不同数据库之间进行迁移时,则不需要对业务sql 阅读全文
posted @ 2022-08-26 15:09 小吉猫 阅读(120) 评论(0) 推荐(0)
摘要:CHANGE MASTER TO 语句 CHANGE MASTER TO option [, option] ... [ channel_option ] option: { MASTER_BIND = 'interface_name' | MASTER_HOST = 'host_name' | M 阅读全文
posted @ 2022-06-08 12:40 小吉猫 阅读(323) 评论(0) 推荐(0)
摘要:官方文档 https://www.percona.com/doc/percona-xtrabackup/2.4/index.html Percona XtraBackup介绍 Percona XtraBackup是基于MySQL的服务器的开源热备份实用程序,在备份期间不会锁定您的数据库。 它可以备份 阅读全文
posted @ 2022-03-21 14:25 小吉猫 阅读(920) 评论(0) 推荐(0)
摘要:1.先进入主库,进行锁表,防止数据写入 mysql> flush tables with read lock; 2.进行数据备份 /usr/local/mysql/bin/mysqldump -uroot -p --quick --routines --master-data=2 --single- 阅读全文
posted @ 2022-03-03 17:52 小吉猫 阅读(235) 评论(0) 推荐(0)
摘要:MySQL server has gone away https://dev.mysql.com/doc/refman/5.7/en/gone-away.html Lost connection to server during query 该MySQL server has gone away错误 阅读全文
posted @ 2022-03-03 13:24 小吉猫 阅读(188) 评论(0) 推荐(0)
摘要:max_connections 命令行格式 --max-connections=# 系统变量 max_connections 范围 global 动态的 是的 类型 整数 默认值 151 最小值 1 最大值 100000 允许的最大同时客户端连接数。最大有效值是open_files_limit-81 阅读全文
posted @ 2022-03-03 11:38 小吉猫 阅读(207) 评论(0) 推荐(0)
摘要:安装依赖 root@mysql-01:~# apt -y install libncurses-dev libncurses5 创建用户 root@mysql-01:~# groupadd -g 27 -o -r mysql && useradd -M -N -g mysql -o -r -d /d 阅读全文
posted @ 2021-10-30 21:27 小吉猫 阅读(264) 评论(0) 推荐(0)