Solved

Single instance of MySQL listening on multiple ports

Posted on 2006-06-18
3
2,938 Views
Last Modified: 2008-01-09
I need to configure a MySQL 5 instance on a SuSE Linux server to listen on multiple ports. Ex. 3306 & 3307 & 3308

I do not want to run  multiple instances on MySQL on the same machine, I know how to do that. I want to access the same instance from multiple ports.

Thanks,
0
Comment
Question by:MrPickle
3 Comments
 
LVL 14

Expert Comment

by:ppfoong
ID: 16931481

Yes, you can make use of mysqld_multi.

http://dev.mysql.com/doc/refman/5.0/en/mysqld-multi.html

0
 

Author Comment

by:MrPickle
ID: 16932033
I looked at the paged you linked. I do not believe mysqld_multi does what I am trying to do. mysqld_multi is a tool used to manage multiple instances of mysql. Each instance is like a separate server. The example they used in the page you linked to was 4 seperate instances for 4 different languages. If I am missing something please clarify the portion of this documentation you were referring to and how I could use mysqld_multi to run ONE instance of mysql on multiple ports.

Thanks.
0
 
LVL 22

Accepted Solution

by:
NovaDenizen earned 250 total points
ID: 16935545
Making firewall rules?

I think you could do it with appropriate port-forwarding iptables rules.  Usually port-forwarding sends the incoming connection to an otherwise unroutable host on a local subnet, but you could also set it up to forward to another port on the same machine.  Or you could set your firewall up to forward all ports in that range to the main mysql port.

This guy seems to know what he's talking about (I'm no iptables expert): http://www.hackorama.com/network/portfwd.shtml

If your mysql hosts' ip is xxx.xxx.xxx.xxx, I think you could do these two rules to forward 3307 to 3306:
/sbin/iptables -t nat -A PREROUTING -p tcp -i eth0 -d xxx.xxx.xxx.xxx
             --dport  3307 -j DNAT --to xxx.xxx.xxx.xxx:3306
/sbin/iptables -A FORWARD -p tcp -i eth0 -d xxx.xxx.xxx.xxx --dport 3306 -j ACCEPT

0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now