十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
多套后台进程+线程+内存结构
创新互联建站是一家专注于网站设计制作、成都做网站与策划设计,渭城网站建设哪家好?创新互联建站做网站,专注于网站建设10余年,网设计领域的专业建站公司;建站业务涵盖:渭城等地区。渭城做网站价格咨询:028-86922220
多个端口,多个配置文件,多个日志文件,多个socket,多个server_id
多套数据
##PS:安装多实例前,首先确保MySQL数据库已安装,mysql安装参考:https://blog.51cto.com/zhuzhiwei/2140683
mkdir -p /data/330{7..9} #<=====创建多个目录
================第一个实例===================
vim /data/3307/my.cnf
[mysqld]
basedir=/application/mysql
datadir=/data/3307/data
socket=/data/3307/mysql.sock
log-error=/data/3307/mysql.log
log-bin=/data/3307/mysql-bin
server-id=7
port=3307
[client]
socket=/data/3307/mysql.sock
================第二个实例===================
vim /data/3308/my.cnf
[mysqld]
basedir=/application/mysql
datadir=/data/3308/data
socket=/data/3308/mysql.sock
log-error=/data/3308/mysql.log
log-bin=/data/3308/mysql-bin
server-id=8
port=3308
[client]
socket=/data/3308/mysql.sock
================第三个实例===================
vim /data/3309/my.cnf
[mysqld]
basedir=/application/mysql
datadir=/data/3309/data
socket=/data/3309/mysql.sock
log-error=/data/3309/mysql.log
log-bin=/data/3309/mysql-bin
server-id=9
port=3309
[client]
socket=/data/3309/mysql.sock
=========================================
chown -R mysql.mysql /data/330* #<======将3个目录授权给mysql用户
/application/mysql/scripts/mysql_install_db --user=mysql --basedir=/application/mysql --datadir=/data/3307/data
=================================================================================
/application/mysql/scripts/mysql_install_db --user=mysql --basedir=/application/mysql --datadir=/data/3308/data
=================================================================================
/application/mysql/scripts/mysql_install_db --user=mysql --basedir=/application/mysql --datadir=/data/3309/data
=================================================================================
mysqld_safe --defaults-file=/data/3307/my.cnf &
====================================================================
mysqld_safe --defaults-file=/data/3308/my.cnf &
====================================================================
mysqld_safe --defaults-file=/data/3309/my.cnf &
====================================================================
touch /data/3309/mysql.log
touch /data/3308/mysql.log
touch /data/3307/mysql.log
chown -R mysql.mysql /data/330*
再次启动多个实例即可。
===============进入实例===============================
mysql -s /data/3307/mysql.sock #首次进入无密码
mysql -s /data/3308/mysql.sock
mysql -s /data/3309/mysql.sock