In order to lower system usage I'm planning to use another server to store my databases. so how can I redirect MySQL queries to another server or make MySQL to store databases on another server?
closed as not a real question by HopelessN00b, mdpc, Bryan, chutz, growse Dec 22 '12 at 17:40
It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ.
You can use something like mysql proxy link1 link2 for it. But it's not very well supported. Additionally, decrease in performance is somewhat significant. If possible, I would suggest you to simply tell your application to connect to the actual mysql server with a choice. For example, with PHP, there is mysqlnd_ms which allows multiple mysql servers to be added and it load balances among them.
The best way is to forward all the traffic from 3306 port to the 3306 port of destination IP address where you are running mysql.
You can use different packet forwarding applications like iptables, packet filter etc, according to the operating system you are using.
As this works at the packet layer and not really at the application layer, so you will skip the over head of using application to do the redirection. This will be significantly faster than using traditional applications like MysqlProxy.
MysqlProxy is useful when you need the application level understanding, like if you want to redirect mysql write requests to one server and read requests to other servers, but in this scenario, using mysql proxy will be a big extra over head.