We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
我平时使用pymysql链接mysql数据库,电脑上只安装了pymysql,运行项目时报错“No module named 'MySQLdb'”。 看了requirements.txt内又没有列出这个模块,有点摸不着头脑。 折腾了很久才在知乎找到答案。https://www.zhihu.com/question/29719547
app.config['SQLALCHEMY_DATABASE_URI'] 如下定义时会程序会引用MySQLdb模块: app.config['SQLALCHEMY_DATABASE_URI'] = "mysql://laimingxing:[email protected]/test"
app.config['SQLALCHEMY_DATABASE_URI'] = "mysql://laimingxing:[email protected]/test"
如下定义时才会引用pymysql模块: app.config['SQLALCHEMY_DATABASE_URI'] = "mysql+pymysql://laimingxing:[email protected]/test"
app.config['SQLALCHEMY_DATABASE_URI'] = "mysql+pymysql://laimingxing:[email protected]/test"
The text was updated successfully, but these errors were encountered:
你的回答很有帮助 ,谢谢 @pjxxcc
Sorry, something went wrong.
No branches or pull requests
我平时使用pymysql链接mysql数据库,电脑上只安装了pymysql,运行项目时报错“No module named 'MySQLdb'”。
看了requirements.txt内又没有列出这个模块,有点摸不着头脑。
折腾了很久才在知乎找到答案。https://www.zhihu.com/question/29719547
app.config['SQLALCHEMY_DATABASE_URI'] 如下定义时会程序会引用MySQLdb模块:
app.config['SQLALCHEMY_DATABASE_URI'] = "mysql://laimingxing:[email protected]/test"
如下定义时才会引用pymysql模块:
app.config['SQLALCHEMY_DATABASE_URI'] = "mysql+pymysql://laimingxing:[email protected]/test"
The text was updated successfully, but these errors were encountered: