Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6848057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T00:49:17+00:00 2026-05-27T00:49:17+00:00

My program works with a remote MySQL server, and I want to create a

  • 0

My program works with a remote MySQL server, and I want to create a local proxy server on my computer in order to make things faster (pool connections, cache queries etc.). I went by the documentation: http://dev.mysql.com/doc/refman/5.1/en/mysql-proxy.html

I ran, on one console:

erelsgl@ubuntu:~$ mysql-proxy --proxy-backend-addresses=$MYSQL --log-level=debug2011-11-22 09:43:30: (message) mysql-proxy 0.8.2 started
2011-11-22 09:43:30: (debug) max open file-descriptors = 1024
2011-11-22 09:43:30: (message) proxy listening on port :4040
2011-11-22 09:43:30: (message) added read/write backend: qa-srv:3308

And on another console:

erelsgl@ubuntu:~$ mysql --user root --host=localhost --port=4040
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 81
Server version: 5.1.41-3ubuntu12.10 (Ubuntu)

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> show databases;

However, instead of seeing the databases on the remote server (qa-srv) I saw the databases on my local server!

I also tried this:

erelsgl@ubuntu:~$ mysql --user root --host=qa-srv --port=4040
ERROR 2003 (HY000): Can't connect to MySQL server on 'qa-srv' (111)

I also tried running the proxy instead of the mysql daemon:

erelsgl@ubuntu:~$ sudo service mysql stop
mysql stop/waiting
erelsgl@ubuntu:~$ mysql-proxy --proxy-backend-addresses=$MYSQL --log-level=debug --proxy-address=0.0.0.0:3306
2011-11-22 14:14:25: (message) mysql-proxy 0.8.2 started
2011-11-22 14:14:25: (debug) max open file-descriptors = 1024
2011-11-22 14:14:25: (message) proxy listening on port 0.0.0.0:3306
2011-11-22 14:14:25: (message) added read/write backend: qa-srv:3308

And on another console:

erelsgl@ubuntu:~$ mysql --user root
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

How can I tell my mysql client to connect to the remote server via the local proxy?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T00:49:17+00:00Added an answer on May 27, 2026 at 12:49 am

    Hurray! I found the solution.

    On console A:

    erelsgl@ubuntu:~$ mysql-proxy --proxy-backend-addresses=qa-srv:3308 --log-level=debug --proxy-address=127.0.0.1:3306
    2011-11-22 18:55:02: (message) mysql-proxy 0.8.2 started
    2011-11-22 18:55:02: (debug) max open file-descriptors = 1024
    2011-11-22 18:55:02: (message) proxy listening on port 127.0.0.1:3306
    2011-11-22 18:55:02: (message) added read/write backend: qa-srv:3308
    

    On console B:

    erelsgl@ubuntu:~$ mysql -u <username-on-remote-database> -h 127.0.0.1
    

    Or, alternatively, if you still want your local database active:

    On console A:

    erelsgl@ubuntu:~$ mysql-proxy --proxy-backend-addresses=qa-srv:3308 --log-level=debug
    2011-11-22 18:55:02: (message) mysql-proxy 0.8.2 started
    2011-11-22 18:55:02: (debug) max open file-descriptors = 1024
    2011-11-22 18:55:02: (message) proxy listening on port 127.0.0.1:3306
    2011-11-22 18:55:02: (message) added read/write backend: qa-srv:3308
    

    On console B:

    erelsgl@ubuntu:~$ mysql -u <username-on-remote-database> -h 127.0.0.1 -P 4040
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Briefly, I want to connect remote MYSQL firewalled database to my C# program I
When I run the program from IDE (VS2008) it works perfectly. When I want
I wrote a program using Scala's remote actors. My first step was to create
I just want to create a program which crops an image and sends the
Currently I have a website on my local computer that uses PHP to make
So I've created a repo using Git Bash, and it works (Local and Remote
I have a program that works with a variety of files on both the
I have an OpenGL program that works on all of my computers but one.
I've written a C program that works when I pipe data into my program
I have a popup function in a program that works well, be re-loads the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.