locoboy
locoboy

Reputation: 38910

Installing MySQL for python/Django

I'm trying to use MySQL with django and right now the following isn't executing properly:

python manage.py syncdb

I also downloaded the Mysql-python interpreter and ran the following lines but still an error:

python setup.py build
sudo python setup.py install


Traceback (most recent call last):
  File "setup.py", line 15, in <module>
    metadata, options = get_config()
  File "/Users/user/Downloads/MySQL-python-1.2.3/setup_posix.py", line 49, in get_config
    libs = mysql_config("libs")
  File "/Users/user/Downloads/MySQL-python-1.2.3/setup_posix.py", line 24, in mysql_config
    raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: /usr/local/bin/mysql_config not found

I think it's having trouble finding mysql_config, is there a way that I can point the setup to the file? Right now my setup.py is in ~/Downloads and mysql is in /usr/local/mysql/bin

Upvotes: 0

Views: 1837

Answers (3)

locoboy
locoboy

Reputation: 38910

The answer was to edit the site.cfg file so that it points to the mysql_config file in the /usr/local/mysql dir

Upvotes: 0

Ned Deily
Ned Deily

Reputation: 85035

From the path you show, I'm guessing you are running on Mac OS X (you really need to state what platform you are using and what version of Python you are running). However, if you are on Mac OS X, your best bet by far is to use a complete solution of installing compatible versions of Python, MySQL client libraries, MySQLdb, and Django by using one of the third-party open source package managers on OS X: MacPorts, homebrew, Fink, or others.

See, for example, the answer here.

Upvotes: 1

nesv
nesv

Reputation: 812

It seems you may not have any of the MySQL client applications installed. If you are using Linux (and this varies from distribution to distribution), the package you will need to install on Ubuntu is "mysql-client".

Upvotes: 2

Related Questions