Ha, i figured out a hack that works.  Apparently the low level
database connection driver provided by mysql will attempt to use /tmp/
mysql.sock even if you specify 'localhost' or '127.0.0.1' as the
hostname.  To work around this I added an entry to my /etc/hosts file:
127.0.0.1 localhost database

now when I specify the database hostname as 'database' it works!
woot.  An ugly hack, but if fixed the problem =))

-Dan

On Jul 19, 9:18 pm, UnaCoder <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I have django installed on a development box with a local instance of
> mysql.  I'm trying to use mysql on a foreign server over an ssh
> tunnel.  I've connected the foreign mysql server to the local port
> 3307.  I've confirmed I can connect to the database using:
>
> mysql -u username -p'password' -P 3307 --protocol=TCP
>
> however MySQLdb seems intent on connecting to the local database
> through /tmp/mysql.sock when i specify host='localhost' and
> port=3307 ...
>
> Django has the same behavior.
>
> As of right now opening the mysql port on the database server to the
> public is not an option as it is a production database that is secured
> by strict firewall rules...
>
> This is very frustrating, does anyone know how to accomplish this?
>
> Thanks,
> Dan


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to