On 05/16/2010 02:25 PM, bax...@gretschpages.com wrote:
I know this is something stupid I'm missing, but I'm not getting it.

I'm trying to run my Django from one cloud instance and the DB from
another, to (hopefully) optimize each server for task and balance the
load a bit.

On the DB server, I have mysql installed and have a working database
running on the default port 3306. I do not have a domain assigned to
this server, only a raw IP.

Can you connect to the server using "python manage.py dbshell"? If not, and assuming you have the correct authentication credentials, then it's not a Django issue at all.

MySQL can be configured to listen only to sockets or to TCP/IP connections. To connect remotely, it must allow for TCP/IP connections and your firewall must allow connections to the port on which MySQL listens, which is typically 3306. I don't know if the connection is encrypted so your authentication credentials and data might be transported in the clear. PostgreSQL is much more flexible in terms of authentication. You can specify that any TCP/IP connections be over SSL, for example. If you must use MySQL, then you should probably set up a VPN between the two machines and configure the firewall on your MySQL server to not allow connections to port 3306 unless it comes across the VPN tunnel.

In the interim, if you find that MySQL is configured to listen for TCP/IP connections on port 3306 but your firewall rules block that port, you can always use ssh port-forwarding to test. Get a shell on your MySQL server from your local machine like so:

ssh -L 3306:localhost:3306 your-mysql-server.com

Assuming you don't have anything listening on port 3306 on localhost, this will forward any requests to that port across the SSH tunnel to port 3306 of your-mysql-server.com. If you're running MySQL on localhost and it's configured to listen on 3306, just pick some other port above 1024 that isn't used, e.g. 9999, in which case, you'd do:

ssh -L 9999:localhost:3306 your-mysql-server.com
--
Regards,

Clifford Ilkay
Dinamis
1419-3266 Yonge St.
Toronto, ON
Canada  M4N 3P6

<http://dinamis.com>
+1 416-410-3326

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to