SQL >> Database >  >> RDS >> Mysql

De MySQLdb-importfout oplossen met Django op OS X

Je zult hetzelfde probleem tegenkomen bij het installeren van het pakket psycopg2 voor PostgreSQL. De oplossing is om je MySQL-bin-directory toe te voegen aan de PATH.

Volg deze stappen:

1. Download het DMG-archief en installeer de nieuwste officiële MySQL Community Server: mysql-5.7.9

2. Voeg de MySQL-bin-directory toe aan je PATH door dit achter je ~/.bash_profile te plakken:

# voeg de mysql bin-directory toe PATH="/usr/local/mysql/bin/:${PATH}" export PATH 

3. Herstart je computer.

4. Voer pip install mysql-python uit

Als alles goed gaat, zie je: Successfully installed mysql-python-1.2.5

  1. Fout: Handshake inactivity timeout in de Node.js MySQL-module

  2. MySQLdb voor Python installeren en mysql_config-problemen oplossen

  3. “No module named MySQLdb” in Python3 oplossen

  4. Django MySQL-fout bij migrate