Feature #44469
closedFeature request: Support for MySQL/MariaDB database socket configuration
Description
Hello,
I would like to suggest adding an option to configure a Unix socket for MySQL/MariaDB connections.
Currently, database configuration generally uses parameters such as:
DB_HOST
DB_PORT
DB_NAME
DB_USER
DB_PASS
It would be useful to have an additional option such as:
DB_SOCKET: /var/run/mysqld/mysqld.sock
When DB_SOCKET is defined, Redmine could use the Unix socket instead of TCP/IP for the database connection.
This would be particularly useful for Docker/container deployments where MariaDB/MySQL is running on the same host and the database socket can be securely mounted into the container.
For example:
DB_TYPE: mysql
DB_SOCKET: /var/run/mysqld/mysqld.sock
DB_NAME: redmine
DB_USER: redmine_user
DB_PASS: "..."
This could result in:
production:
adapter: mysql2
socket: /var/run/mysqld/mysqld.sock
database: redmine
username: redmine_user
password: "..."
The socket option could take precedence over DB_HOST and DB_PORT when specified, while preserving the existing TCP configuration when DB_SOCKET is not defined.
This would provide more flexibility for local MySQL/MariaDB deployments without changing the existing configuration behaviour.
Thank you for considering this feature.
Updated by Holger Just 2 days ago
- Status changed from New to Closed
- Resolution set to Invalid
The config/database.yml file must be created by the server administrator according to their respective requirements. As such, administrators can create the file using the content you need.
An example is provided in config/database.yml.example.