Description
Trying to connect to localhost via MySQL/TCP-IP fails if the socket is not available (In my case, port 3306 is already redirected externally via ssh). The error says Can't connect to local server through socket '' (111).
If I'm understanding the documentation correctly (https://dev.mysql.com/doc/c-api/8.4/en/mysql-real-connect.html), the problem is that in
|
PAnsiChar(Utf8Encode(FinalSocket)), |
PAnsiChar(Utf8Encode(FinalSocket)) is sending an empty string instead of nil, because the library treats
localhost as a special case.
Changing hosntame to 127.0.0.1 acts as a workaround for now
HeidiSQL version and OS
12.21 linux GTK3 (rpm)
Database server version
Reproduction recipe
- Disable sockets in mysql (or connect to a remote server via ssh and redirect tcp port)
- Connect to "localhost"
Description
Trying to connect to
localhostvia MySQL/TCP-IP fails if the socket is not available (In my case, port 3306 is already redirected externally via ssh). The error saysCan't connect to local server through socket '' (111).If I'm understanding the documentation correctly (https://dev.mysql.com/doc/c-api/8.4/en/mysql-real-connect.html), the problem is that in
HeidiSQL/source/dbconnection.pas
Line 2577 in ca238aa
PAnsiChar(Utf8Encode(FinalSocket))is sending an empty string instead of nil, because the library treatslocalhostas a special case.Changing hosntame to
127.0.0.1acts as a workaround for nowHeidiSQL version and OS
12.21 linux GTK3 (rpm)
Database server version
Reproduction recipe