If you are under budget, you can install multiple MySQL on a single server, but this is not recommended in the production library
[Email protected] scripts]#./mysql_install_db--basedir=/usr/local/mysql--datadir=/data/mysql_3306-- DEFAULTS-FILE=/ETC/MY.CNF--user=mysql [[email protected]]#./mysql_install_db--basedir=/usr/local/mysql--datadir= /DATA/MYSQL_3308--DEFAULTS-FILE=/ETC/MY.CNF--user=mysql [[email protected]]#./mysqld_multi--defaults-file=/etc/ MY.CNF start 3306,3308[[email protected] bin]#./mysqld_multi reportreporting mysqlserversmysql server Fromgroup: mysqld3306 is Runningmysql server fromgroup:mysqld3308 is running
[
[email protected] bin]# mysql-uroot -p -p3306 -h 192.168.1.48enter Password:welcome to the mysqlmonitor. commands end with ; or \g.Your MySQLconnection id is 6Server version:5.6.16-log MySQL community server (GPL) Copyright (c) 2000,2014, oracle and/or its affiliates. all rights reserved. oracle is aregistered trademark of Oracle Corporation and/or itsaffiliates. Othernames may be trademarks of their respectiveowners. type ' help; ' or ' \h ' for help. type ' \c ' to clear the current input statement. mysql> showdatabases;+--------------------+| database |+--------------------+| information_schema| | 3306db | | mysql | | performance_schema| | test |+-------- ------------+5 rows in set (0.00SEC)
[[Email protected] bin] #mysql -uroot -p -s /data/mysql_3306/mysql_3306.sockenter password:Welcome to the MySQLmonitor. Commands end with ; or \g.your mysqlconnection id is 7server version:5.6.16-log mysql community server (GPL) Copyright (c) 2000,2014, oracle and/or its affiliates. all rights reserved. oracle is aregistered trademark of Oracle Corporation and/or itsaffiliates. Othernames may be trademarks of their respectiveowners. type ' help; ' or ' \h ' for help. type ' \c ' to clear the current input statement. mysql> showdatabases;+--------------------+| database |+--------------------+| information_schema| | 3306db | | mysql | | performance_schema| | test |+-------- ------------+5 rows in set (0.00SEC)
[[Email protected] bin] #mysql -uroot -p -P3308 -h 192.168.1.48Enter Password:welcome to the mysqlmonitor. commands end with ; or \g.Your MySQLconnection id is 7Server version:5.6.16-log MySQL community server (GPL) Copyright (c) 2000,2014, oracle and/or its affiliates. all rights reserved. oracle is aregistered trademark of Oracle Corporation and/or itsaffiliates. Othernames may be trademarks of their respectiveowners. type ' help; ' or ' \h ' for help. type ' \c ' to clear the current input statement. mysql> showdatabases;+--------------------+| database |+--------------------+| information_schema| | 3308db | | mysql | | performance_schema| | test |+-------- ------------+5 rows in set (0.00sec) mysql> quitbye
[[Email protected] bin] #mysql -uroot -p -s /data/mysql_3308/mysql_3308.sockenter password:Welcome to the MySQLmonitor. Commands end with ; or \g.your mysqlconnection id is 9server version:5.6.16-log mysql community server (GPL) Copyright (c) 2000,2014, oracle and/or its affiliates. all rights reserved. oracle is aregistered trademark of Oracle Corporation and/or itsaffiliates. Othernames may be trademarks of their respectiveowners. type ' help; ' or ' \h ' for help. type ' \c ' to clear the current input statement. mysql> showdatabases;+--------------------+| database |+--------------------+| information_schema| | 3308db | | mysql | | performance_schema| | test |+-------- ------------+5 rows in set (0.00SEC)
This article is from the "Age volt" blog, please make sure to keep this source http://suifu.blog.51cto.com/9167728/1753992
MySQL Multi-instance installation