时间:2021-07-01 10:21:17 帮助过:20人阅读
③ 将脚本和安装包放置同一目录
④ 编写my.cnf文件并放置在/etc/ 目录下
[mysqld_multi] mysqld = /usr/local/mysql/bin/mysqld mysqladmin = /usr/local/mysql/bin/mysqladmin log = /tmp/mysql_multi.log [mysqld1] federated # 设置数据目录 [多实例中一定要不同] datadir = /data/mysql_data1 # 设置sock存放文件名 [多实例中一定要不同] socket = /tmp/mysql.sock1 # 设置监听开放端口 [多实例中一定要不同] port = 3306 # 设置运行用户 user = mysql # 关闭监控 performance_schema = off # 设置innodb 缓存大小 innodb_buffer_pool_size = 32M # 设置监听IP地址 bind_address = 0.0.0.0 # 关闭DNS 反向解析 skip-name-resolve = 0 max_connections=1000 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES explicit_defaults_for_timestamp=true tmpdir=/data/mysql_data1 character_set_server = utf8mb4 [mysqld2] datadir = /data/mysql_data2 socket = /tmp/mysql.sock2 tmpdir=/data/mysql_data2 port = 3307 user = mysql performance_schema = off innodb_buffer_pool_size = 32M bind_address = 0.0.0.0 skip-name-resolve = 0 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES explicit_defaults_for_timestamp=true lower_case_table_names = 1 [mysqld3] datadir = /data/mysql_data3 socket = /tmp/mysql.sock3 tmpdir=/data/mysql_data3 port = 3308 user = mysql performance_schema = off innodb_buffer_pool_size = 32M bind_address = 0.0.0.0 skip-name-resolve = 0 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES explicit_defaults_for_timestamp=true lower_case_table_names = 1 [mysqld4] datadir = /data/mysql_data4 socket = /tmp/mysql.sock4 tmpdir=/data/mysql_data4 port = 3309 user = mysql performance_schema = off innodb_buffer_pool_size = 32M bind_address = 0.0.0.0 skip-name-resolve = 0 sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES explicit_defaults_for_timestamp=true
⑤ 赋予脚本运行权限并运行
执行结果:
⑥ 修改默认密码
记得修改每一个默认密码哦
centos 安装多实例数据库
标签:设置 多实例 utf8 xpl etc size sql_mod linux str