Solved

Single instance of MySQL listening on multiple ports

Posted on 2006-06-18
3
3,017 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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

This guide whil teach how to setup live replication (database mirroring) on 2 servers for backup or other purposes. In our example situation we have this network schema (see atachment). We need to replicate EVERY executed SQL query on server 1 to…
Foreword This is an old article.  Instead of using the MySQL extension that was used in the original code examples, please choose one of the currently supported database extensions instead.  More information is available here: MySQLi / PDO (http://…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

772 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