如何在同一台机器上安装多个MySQL的实例
展开全部
给你个linux的配置my.cnf的内容[mysqld_multi]mysqld=/usr/local/mysql/bin/mysqld_safe[client]socket=/tmp/mysql.sockdefault-character-set=utf8[mysqld1]datadir=/usr/local/mysql/databasedir=/usr/local/mysqlcharacter-set-server=utf8default-storage-engine=innodbport=3306table_open_cache=64innodb_data_home_dir=/usr/local/mysql/datainnodb_data_file_path=ibdata1:10M:autoextendinnodb_log_group_home_dir=/usr/local/mysql/datainnodb_buffer_pool_size=50Minnodb_additional_mem_pool_size=2Minnodb_log_file_size=5Minnodb_log_buffer_size=8Minnodb_flush_log_at_trx_commit=1innodb_lock_wait_timeout=50[mysqld2]datadir=/usr/local/mysql/data1basedir=/usr/local/mysqlcharacter-set-server=utf8default-storage-engine=innodbport=3307table_open_cache=64innodb_data_home_dir=/usr/local/mysql/data1innodb_data_file_path=ibdata1:10M:autoextendinnodb_log_group_home_dir=/usr/local/mysql/data1innodb_buffer_pool_size=50Minnodb_additional_mem_pool_size=2Minnodb_log_file_size=5Minnodb_log_buffer_size=8Minnodb_flush_log_at_trx_commit=1innodb_lock_wait_timeout=50----【mysqld】中的配置和单实例的mysqld配置一致,多实例中每个[mysqld]需要有不同的端口号,sock,datadir然后是启动:/usr/local/mysql/bin/mysqld_mulit--defaults-extra-file=/etc/my.cnfstart1----这里的数字1对应[mysqld1],关闭就是把start改成stop,启动所有就是startall其他命令你自己网上查下吧
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询