Opened 19 years ago

Closed 19 years ago

Last modified 17 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

Description

Hi,

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 :)

Cheers,

Geert

Attachments (1)

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

Download all attachments as: .zip

Change History (4)

by Geert Vanderkelen <geert@…>, 19 years ago

Attachment: mysql_base_unixsocket.diff added

Using alternate UNIX Socket for MySQL

comment:1 by Roman, 19 years ago

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 by Adrian Holovaty, 19 years ago

Resolution: fixed
Status: newclosed

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

comment:3 by anonymous, 18 years ago

thanks

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