Hi,
I’m getting the following error when connecting to a remote MySQL server through HAProxy:
Lost connection to MySQL server at 'reading initial communication packet', system error: 0 [Code: 2013]
My config:
listen MySQL
bind localhost:3306
mode tcp
maxconn 10
balance roundrobin
server mysql_slave remotemysql.com:3306 maxconn 1
(I use the 127.0.0.1:3306
address to connect from few client applications, on the same machine where HAProxy is installed). OS is Ubuntu 20.04.
Here are my requirements:
- Multiple applications connect to the router/proxy against the same MySQL credentials (same DB and user)
- Router/proxy establishes a single connection using the same MySQL credentials than the client applications; that is, doesn’t simply forward each connection coming from each application to the server.
- Queries from all clients will end in the single MySQL connection from the proxy to the remote server, and get response back to each requesting client, accordingly
About 4 connections are persistent (specific applications), then few other might be temporarily created (website access).
For reference, MySQL server version is 8.0.13-4
, but I don’t have administrative access at all to it (only to my machine, where HAProxy resides).
Thank you.