Skip to content
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

Fix MySQL UNIX socket support #5166

Merged
merged 1 commit into from Mar 5, 2023
Merged

Fix MySQL UNIX socket support #5166

merged 1 commit into from Mar 5, 2023

Conversation

kgraefe
Copy link
Contributor

@kgraefe kgraefe commented Mar 5, 2023

Changes proposed in this pull request:

  • This changes fixes MySQL UNIX socket support as MySQL uses different parameters for passing UNIX socket paths (unix_socket) and TCP sockets (host) in contrast to PosgreSQL which uses one for both (host). See also PDO_MYSQL DSN and PDO_PGSQL DSN.

This has probably been broken since the beginning (#1889).

How to test the feature manually:

  1. Set $config['db']['type'] to mysql
  2. Set $config['db']['host'] to socket path (e.g. /run/mysqld/mysqld.sock)
  3. Run fails with Access to database is denied forfeeds: SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo for /run/mysqld/mysqld.sock failed: Name or service not known

Pull request checklist:

  • clear commit messages
  • code manually tested
  • unit tests written (optional if too hard)
  • documentation updated

Additional information can be found in the documentation.

MySQL uses different parameters for passing UNIX socket pathts
(unix_socket) and TCP sockets (host) in contrast to PosgreSQL which uses
one for both (host).

Signed-off-by: Konrad Gräfe <kgraefe@paktolos.net>
@Alkarex Alkarex added this to the 1.22.0 milestone Mar 5, 2023
@Alkarex Alkarex merged commit 16472fd into FreshRSS:edge Mar 5, 2023
@Alkarex
Copy link
Member

Alkarex commented Mar 5, 2023

Looks good, thanks!
Please add a line for you in https://github.com/FreshRSS/FreshRSS/blob/edge/CREDITS.md

@kgraefe kgraefe mentioned this pull request Mar 5, 2023
@kgraefe kgraefe deleted the fix-mysql-unix-socket branch March 5, 2023 19:53
@Alkarex Alkarex linked an issue Sep 5, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Configuration example for MySQL Unix socket needed
2 participants