How do I install the 'mysqldb' module using pip?

Responsive Ad Header

Question

Grade: Education Subject: Support
How do I install the 'mysqldb' module using pip?
Asked by:
48 Viewed 48 Answers

Answer (48)

Best Answer
(368)
While `mysqldb` is the name you might see in older tutorials, it's generally recommended to use `mysqlclient` instead. Install it using pip with the command: `pip install mysqlclient`. You may need to have MySQL development libraries installed on your system (e.g., `libmysqlclient-dev` on Debian/Ubuntu, `mysql-devel` on CentOS/RHEL) before installing `mysqlclient`.