Opened 18 years ago

Closed 18 years ago

Last modified 16 years ago

#1481 closed enhancement (fixed)

[patch] Using alternate MySQL unix socket

Reported by: Geert Vanderkelen <geert@…> Owned by: Adrian Holovaty
Component: Database layer (models, ORM) Version: magic-removal
Severity: normal Keywords: mysql socket unix_socket
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no



Attached a patch which allows an alternate UNIX socket to be used for MySQL. The default is /tmp/mysql.sock, but this is mostly changed to a path like /var/run/mysql or /var/lib/mysql in production.

I have made it so that when DATABASE_HOST starts with a '/' it is a socket, otherwise it's a HOST. This might not work on Windows, but heck, who's using namedpipes anyway :)



Attachments (1)

mysql_base_unixsocket.diff (768 bytes) - added by Geert Vanderkelen <geert@…> 18 years ago.
Using alternate UNIX Socket for MySQL

Download all attachments as: .zip

Change History (4)

Changed 18 years ago by Geert Vanderkelen <geert@…>

Attachment: mysql_base_unixsocket.diff added

Using alternate UNIX Socket for MySQL

comment:1 Changed 18 years ago by Roman

I found this patch very useful in some cases. I'm getting trouble using shared hosting with dedicated database where connections to MySQL db are establised via non standard socket like "/home/username/tmp/mysql-socket"

comment:2 Changed 18 years ago by Adrian Holovaty

Resolution: fixed
Status: newclosed

(In [2736]) magic-removal: Fixed #1481 -- Added support for using alternate MySQL Unix sockets. Thanks, Geert Vanderkelen

comment:3 Changed 16 years ago by anonymous


Note: See TracTickets for help on using tickets.
Back to Top