Django

Code

Ticket #1481 (closed: fixed)

Opened 3 years ago

Last modified 2 years ago

[patch] Using alternate MySQL unix socket

Reported by: Geert Vanderkelen <geert@kemuri.org> Assigned to: adrian
Milestone: Component: Database layer (models, ORM)
Version: magic-removal Keywords: mysql socket unix_socket
Cc: Triage Stage: Unreviewed
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

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

mysql_base_unixsocket.diff (0.8 kB) - added by Geert Vanderkelen <geert@kemuri.org> on 03/08/06 18:06:35.
Using alternate UNIX Socket for MySQL

Change History

03/08/06 18:06:35 changed by Geert Vanderkelen <geert@kemuri.org>

  • attachment mysql_base_unixsocket.diff added.

Using alternate UNIX Socket for MySQL

04/09/06 00:16:12 changed 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"

04/23/06 17:18:55 changed by adrian

  • status changed from new to closed.
  • resolution set to fixed.

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

06/15/07 06:02:58 changed by anonymous

thanks


Add/Change #1481 ([patch] Using alternate MySQL unix socket)




Change Properties
Action