-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mysql connection fails when connecting to localhost. "Can't connect to local MySQL server through socket when" #478
Comments
Exactly as #376 , jekyll 4.2.2. #376 was closed and ignored. After some digging, the problem seems to be in libmysql. Although insane, but it's mysql, so insanity is the norm. It is explained here: https://dev.mysql.com/doc/c-api/8.0/en/mysql-real-connect.html The value of host may be either a host name or an IP address. The client attempts to connect as follows:
You can also influence the type of connection to use with the MYSQL_OPT_PROTOCOL or MYSQL_OPT_NAMED_PIPE options to mysql_options(). The type of connection must be supported by the server. |
So please update the sample code and default configuration from "localhost" into "127.0.0.1" |
@jrz You never mention which importer was used though. |
Oh worry, it was the wordpress importer (self-hosted), but I noticed joomla has default settings to localhost as well |
@jrz Let us leave #376 in the past. This current ticket has more context thanks to your investigation and diagnosis that the issue is ultimately with libmysql. Pinging @parkr for technical inputs:
|
The problem really lies withing libmysql. I don't think postgres has this problem. I assume that Oracle doesn't change this behavior because of backwards compatibility. Anyone who's using sockets probably hasn't changed "host" into something else. If they did, it's wrong, and also easy to detect (connnection will fail because it's trying to connect to an inet host. It'll be obvious, because the hostname is set in the configuration). Anyone else who's using an inet connection, and has it working, is already not using "localhost", because it simply doesn't work. There was also an issue where socket was set to "" instead of nil. It's related in terms of impact. Not sure about the versions there. |
This issue has been automatically marked as stale because it has not been commented on for at least two months. The resources of the Jekyll team are limited, and so we are asking for your help. If this is a bug and you can still reproduce this error on the If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial. This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions. |
I’m comfortable updating the defaults for MySQL-backed databases to use 127.0.0.1 for the host. |
This issue has been automatically marked as stale because it has not been commented on for at least two months. The resources of the Jekyll team are limited, and so we are asking for your help. If this is a bug and you can still reproduce this error on the If this is a feature request, please consider whether it can be accomplished in another way. If it cannot, please elaborate on why it is core to this project and why you feel more than 80% of users would find this beneficial. This issue will automatically be closed in two months if no further activity occurs. Thank you for all your contributions. |
Otherwise it tries to connect using a socket
The text was updated successfully, but these errors were encountered: