TypechoJoeTheme

Jim Tse

搜索到 5 篇与 的结果 ———数据库
2020-05-05

【Docker】创建redis集群

【Docker】创建redis集群
docker network create redis --subnet 172.38.0.1/16 #通过脚本一次创建6个redis配置 for port in $(seq 1 6); \ do \ mkdir -p /home/redis/node-${port}/conf touch /home/redis/node-${port}/conf/redis.conf cat << EOF >/home/redis/node-${port}/conf/redis.conf port 6379 bind 0.0.0.0 cluster-enabled yes cluster-config-file nodes.conf cluster-node-timeout 5000 cluster-announce-ip 172.38.0.1${port} cluster-announce-port 6379 cluster-announce-bus-port 16379 appendonly yes EOF # 通过脚本一次启动6个redis容器 docker run -...
2020年05月05日
0 阅读
0 评论
2020-05-05

【MySQL】binlog恢复误删数据

【MySQL】binlog恢复误删数据
mysql开启binlog[mysql] # 设置mysql客户端默认字符集 default-character-set=utf8 [mysqld] #设置3306端口 port = 3306 # 设置mysql的安装目录 basedir=D:\\Program Files\\mysql-5.7.29-winx64 # 设置mysql数据库的数据的存放目录 datadir=D:\\Program Files\\mysql-5.7.29-winx64\\data # 允许最大连接数 max_connections=200 # 服务端使用的字符集默认为UTF8 character-set-server=utf8 # 创建新表时将使用的默认存储引擎 default-storage-engine=INNODB server-id = 1 sync_binlog=1 log_bin = mysql-bin binlog_format = row expire_logs_days = 7 log_error = D:\\Program Files\\mysql-5.7.29-winx...
2020年05月05日
0 阅读
0 评论
2020-05-05

【Redis】docker compose 部署哨兵集群模式

【Redis】docker compose 部署哨兵集群模式
哨兵基础认识关于 Redis 哨兵的介绍:一个哨兵就是一个 redis-sentinel 服务,默认使用 26379 端口。和 Redis 服务是分开的,可以理解为一个哨兵就是一台额外的服务器,用来监控 Redis 服务能不能正常运行。多个哨兵就是多个 redis-sentinel 服务,每个可以部署在不同的机器上,甚至可以全部部署在同一台机器上,监听不同端口就行了,但这样就失去了多个哨兵的意义。所有的哨兵都是监听同一个 Redis 服务的,就是 Master 服务,也就是说哨兵的数量和 Redis 服务的数量没有任何关系。哨兵只需要监听 Redis Master 服务,因为 Slave 信息会注册在 Master 上,所有哨兵通过 Master 就可以知道所有的 Slave 服务信息了。每个哨兵只需要知道当前的 Redis Master 服务是谁就行了,不需要知道其他哨兵的信息,因为他们会在 Master 上通过相互沟通得知当前其他哨兵的情况。目录结构sentinel/ ├── docker-compose.yml ├── master │ ├── data/ │ └─...
2020年05月05日
0 阅读
0 评论
2020-05-05

【MySQL】修改数据库字符集

【MySQL】修改数据库字符集
修改mysql 配置文件, 在my.cnf文件中增加character-set-server=utf8mb4 collation-server=utf8mb4_general_ci然后重启mysql修改数据库、表、字段的字符集和collation-- 首先,查询当前数据库中所有表的名称和字符集 SELECT TABLE_NAME, TABLE_COLLATION FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'your_database_name'; -- 然后,使用ALTER TABLE语句来修改每个表的字符集和字符串字符集 -- 例如,将名为your_table_name的表的字符集和字符串字符集修改为utf8mb4 ALTER TABLE your_table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;SET FOREIGN_KEY_CHECKS=0; //To Change database collation AL...
2020年05月05日
0 阅读
0 评论
2020-05-05

【MySQL】压缩版安装

【MySQL】压缩版安装
官网下载MySQL压缩版MySQL压缩版添加my.ini文件# MySQL Server Instance Configuration File # ---------------------------------------------------------------------- # Generated by the MySQL Server Instance Configuration Wizard # # # Installation Instructions # ---------------------------------------------------------------------- # # On Linux you can copy this file to /etc/my.cnf to set global options, # mysql-data-dir/my.cnf to set server-specific options # (@localstatedir@ for this installation) or to # ~/.my...
2020年05月05日
0 阅读
0 评论

人生倒计时

今日已经过去小时
这周已经过去
本月已经过去
今年已经过去个月

标签云