[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Single instance of MySQL listening on multiple ports

Posted on 2006-06-18
3
Medium Priority
?
3,328 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 1000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL several years ago, it seemed like now was a good time to update it for object-oriented PHP.  This article does that, replacing as much as possible the pr…
In this article, I’ll talk about multi-threaded slave statistics printed in MySQL error log file.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

650 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