PyCharm import MySQL

13,112

You can use pymysql installing through PyCharm instead of MySQLdb. It's a drop-in replacement for it.

Documentation: https://github.com/PyMySQL/PyMySQL

Share:
13,112
Ancalagon BerenLuthien
Author by

Ancalagon BerenLuthien

Updated on June 26, 2022

Comments

  • Ancalagon BerenLuthien
    Ancalagon BerenLuthien almost 2 years

    I am trying

    import MySQLdb as mdb
    

    on PyCharm and get the error:

    ImportError: No module named MySQLdb
    

    From the PyCharm-preference, cannot find MySQLdb to import. pymysql was successfully installed on PyCharm though. Suggestions ? Thank you very much.

    enter image description here enter image description here

  • Ancalagon BerenLuthien
    Ancalagon BerenLuthien over 7 years
    Upvoted. Thanks a lot for answering .... pymysql was already successfully installed on PyCharm, but still cannot import mysqldb.