ModuleNotFoundError: No module named 'MySQLdb'

后端 未结 5 460
眼角桃花
眼角桃花 2020-12-10 05:23

After finishing of one of my Flask projects, I uploaded it on github just like everybody else. after a 2-3 months period I downloaded the entire githube repository on anothe

5条回答
  •  自闭症患者
    2020-12-10 06:13

    I have read that mysqldb is not supported by python3

    And it looks like when you are trying to connect to your database you are using mysql db to connect to the database by default!

    you need to change it by editing your DATABASE_URI configuration

    But before you need to install the connector extension :

    with this command :

    pip install mysql-connector-python
    

    And according to this documentation you can edit your DATABASE_URI and change the default connector like this :

    DATABSE_URI='mysql+mysqlconnector://{user}:{password}@{server}/{database}'.format(user='your_user', password='password', server='localhost', database='dname')
    

    I hope this will help...

提交回复
热议问题