How to start multiple instances of MySQL on a single server db above

Through the installation process will be omitted, please refer to source installation http://write.blog.csdn.net/postlist/1609043/all

Organize their documents and found that under the previous examples do, share, welcome to suggest improvements.

 

First, upload RPM packages to the server

 

 

 

 

Second, the server installation mysql

rpm -ivhMySQL-server-5.5.8-1.rhel5.x86_64.rpm

 

 

 

 

 

 

 

Third, install mysql client

 

rpm -ivhMySQL-client-5.5.8-1.rhel5.x86_64.rpm

 

 

 

 

Fourth, create a directory

 

Created in the / data directory, the original data directory / var / lib / mysql move to the next / data / mysql / data1 and / data / mysql / data2, and modify the mysql directory and subdirectory permissions

 

PS: After the default installation of several important directory

   table of Contents                     

                content

/ Var / lib / mysql        

Data files, log files, etc.

/usr/bin

Client programs and scripts

/usr/share/mysql      

Error message and character set files

/etc/rc.d/init.d/mysql   

Startup script file

 

Create a directory

 

 

 

Modify permissions

 

 

 

Fifth, modify and upload the configuration file my.cnf

 

From / usr on the server / share / mysql directory the my-innodb-heavy-4G.cnf to the local copy. Edit its contents increased catalog data files and log files, modify socket directory. After editing the my-innodb-heavy-4G.cnf rename my.cnf, and upload it to the / etc directory.

 

Sixth, start multiple services with mysql_multi

 

start up:

mysqld_multi --defaults-file=/etc/my.cnf start1,2 &

Check whether to activate:

mysqld_multi --defaults-file=/etc/my.cnfreport 1

 

 

 

 

Seven, to see whether the port is open

 

 

 

 

 

八、连接进入指定的mysql服务器

 

mysql -u root -S/tmp/mysql1.sock

 

 

或者mysql -uroot -P3307 -h127.0.0.1

 

 

 

 

九、记得关闭防火墙

 

Guess you like

Origin blog.csdn.net/csdnhsh/article/details/91787423