[Django]-Configuring Django to use remote mysql server?

3👍

I finally got MySQLdb compiled without installing MySQL server in my MacOSX.

The steps:

  1. Download appropriate MySQL package (tar) not install version and unpack
  2. Download MySQLdb wrapper from MySQL Python bindings
  3. Unpack MySQLdb
  4. Edit site.cfg to point to mysql_config into the directory you have downloaded
  5. Follow the instructions in MySQLdb (essentially build & install)
  6. Copy the file libmysqlclient_r.15.dylib from your ‘mysql/lib’ folder to /usr/local/mysql/lib (assuming you have choosen threadsafe version)
  7. Now you are ready to use MySQLdb with any MySQL server
  8. You can test the installation using: python >>> import MySQLdb
👤lud0h

2👍

You need to install mysql’s client libraries on the machine running Django so it can connect to a remote MySQL server. Both plain libmysqlclient and python’s mysql driver. Further details depend on the platform you are running this on.

1👍

Install a pre-compiled version of the MySQLdb driver. Most Linux distributions provide it in their repositories — for example, in Debian and Ubuntu it’s named python-mysqldb.

Also, as this does not involve programming, it would be best moved to Superuser.

Leave a comment