同一台MySQL服务器启动多个端口
时间:2021-07-01 10:21:17
帮助过:46人阅读
解压 cat INSTLL-BINARY 根据说明操作,具体安装步骤请看 http://www.lishiming.net/thread-7-1-1.html
其中1-4步骤是相同的,第5步,也是最重要的一步,要初始化数据库因为是多个端口,所以要根据配置文件来初始化多个数据库比如说有2个端口则要运行两次 ./scripts/mysql_install_db --datadir=/home/mysql1 --user=mysql./scripts/mysql_install_db --datadir=/home/mysql2 --user=mysql配置文件要编辑成这样[mysqld0]port = 3300socket = /tmp/mysql0.sockpid-file = /home/mysql0/localhost.localdomain0.piddatadir = /home/mysql0#log = /data/mysql0/mysql0.loguser = mysqlskip-lockingskip-name-resolve#skip-bdb#skip-innodbkey_buffer = 128Mmax_allowed_packet = 1Mtable_cache = 864sort_buffer_size = 1Mread_buffer_size = 512Kread_rnd_buffer_size = 1Mmyisam_sort_buffer_size = 32Mthread_cache_size = 16query_cache_size = 32Mthread_concurrency = 8#skip-networkingwait_timeout=8max_connections=512max_connect_errors = 10000000max_user_connections=20#slow_queries=/data/mysql0slowquer.sql#log_slow_queries=/data/mysql0slowquer.sql#long_query_time=3#log-bin=mysql0-bin###########################[mysqld1]port = 3301socket = /tmp/mysql1.sockpid-file = /home/mysql1/localhost.localdomain1.piddatadir = /home/mysql1#log = /data/mysql1/mysql1.loguser = mysqlskip-lockingskip-name-resolve#skip-innodb#skip-bdbkey_buffer = 128Mmax_allowed_packet = 1Mtable_cache = 864sort_buffer_size = 1Mread_buffer_size = 512Kread_rnd_buffer_size = 1Mmyisam_sort_buffer_size = 32Mthread_cache_size = 16query_cache_size = 32Mthread_concurrency = 8#skip-networkingwait_timeout=8max_connections=512max_connect_errors = 10000000max_user_connections=20#log_slow_queries=/data/mysql1slowquer.sql#long_query_time=3#log-bin=mysql1-bin########################################把配置文件放在 /etc/my.cnf最后就该启动了 /usr/local/mysql/bin/mysqld_multi start 0-1 这里的0或1是根据配置文件中"[mysqld0]"来定的。本文出自 “小杨” 博客,请务必保留此出处http://aqiang.blog.51cto.com/6086626/1896093
同一台MySQL服务器启动多个端口
标签:同一台mysql服务器启动多个端口