Skip to content

Support Unix socket connections for MySQL/MariaDB#3845

Draft
Copilot wants to merge 3 commits into
developfrom
copilot/feature-support-socket-mariadb
Draft

Support Unix socket connections for MySQL/MariaDB#3845
Copilot wants to merge 3 commits into
developfrom
copilot/feature-support-socket-mariadb

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 11, 2026

The MySQL connection string builder always wrapped the host in tcp(...), making it impossible to connect via Unix socket as supported by the Go MySQL driver.

Changes

  • util/config.go: Added mysqlHasNetworkPrefix helper that detects known MySQL driver protocol prefixes (tcp, tcp4, tcp6, unix, pipe). GetConnectionString now passes the host as-is when a prefix is already present, otherwise falls back to the existing tcp(...) wrapping.
  • util/config_test.go: Added TestMySQLGetConnectionString covering both TCP and Unix socket host formats.

Usage

In semaphore.json, specify the socket path using the Go MySQL driver's native syntax:

{
  "mysql": {
    "host": "unix(/var/run/mysqld/mysqld.sock)",
    "user": "semaphore",
    "pass": "password",
    "name": "semaphore"
  }
}

Copilot AI linked an issue May 11, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add support for socket connection to MariaDB Support Unix socket connections for MySQL/MariaDB May 11, 2026
Copilot finished work on behalf of fiftin May 11, 2026 10:44
Copilot AI requested a review from fiftin May 11, 2026 10:44
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.

Feature: Support socket for mariadb

2 participants