Search This Blog

Sunday, June 06, 2010

Running Multiple Mysql

Running Multiple Mysql

The easiest way is to run multiple servers on Unix is to compile them with different TCP/IP ports and Unix socket files so that each one is listening on different network interfaces. Compiling in different base directories for each installation also results automatically in a separate, compiled-in data directory, log file, and PID file location for each server.

If the existing Mysql server is configured for the default TCP/IP port number (3306) and Unix socket file (/tmp/mysql.sock).

To configure a new My sql server to have different operating parameters, use a configure command something like this:

shell> ./configure --with-tcp-port=port_number (3307)\
--with-unix-socket-path=file_name (/tmp/new.mysql.sock \
--prefix=/usr/local/mysql-5.1.46

Here, port_number and file_name must be different from the default TCP/IP port number and Unix socket file path name, and the --prefix value should specify an installation directory different from the one under which the existing MySQL installation is located. As mentioned above.

Open the new port in the firewall.

shell> mysqld_safe --socket=file_name --port=port_number
To start a second server, provide different --socket and --port option values, and pass a --datadir=path option to mysqld_safe so that the server uses a different data directory.

Or we can Install multiple Mysql Using the Mysql sandbox tool.

Mysql sandbox :: -- MySQL Sandbox is a tool for installing one or more MySQL servers in isolation, without affecting other servers

No comments: