Solved

Single instance of MySQL listening on multiple ports

Posted on 2006-06-18
3
3,141 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read on. . .
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

688 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