在服务器资源有限的情况下,可利用该方案快速搭建各类 mysql 架构方案。各 MySQL 实例共享一个 mysqld 主程序,但各实例数据目录是独立的,存放在不同的文件夹中;好了、废话不多说,直接上干货,具体搭建步骤如下
环境介绍
实例主机mysql portmysqlx portdatadirmysql1192.168.31.100330633060/var/lib/mysql1/mysql2192.168.31.100330733070/var/lib/mysql2/mysql3192.168.31.100330833080/var/lib/mysql3/部署 MySQL 主程序
#> 2023-03-15T01:22:52.092218Z 0 [System] [MY-013169] [Server] /usr/local/mysql/bin/mysqld (mysqld 8.0.30) initializing of server in progress as process 15026
#> 2023-03-15T01:22:52.119703Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
#> 2023-03-15T01:22:55.237170Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
#> 2023-03-15T01:23:00.616679Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: lqYujqcue7*_