Re: Switching database connection in mysql
Posted by: Filipe Silva
Date: April 20, 2017 09:54AM

You can have as many instances of mysqld you like as long as they don't use the same network and data storage resources.

Assuming that you want both instances running on the same system, you should start both instances with different data directories, ports and sockets (if running on Linux), simply by pointing to two different my.cnf files or by providing the arguments in the command line.

Once you have both servers running, say, one in localhost:3306 and the other in localhost:3307, then just point to the one you want to use in the JDBC connection URL. You can even have one connection for one server and another for the other.

I hope that helps.

Options: ReplyQuote


Subject
Written By
Posted
Re: Switching database connection in mysql
April 20, 2017 09:54AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.