我正在使用Flask/mysql构建一个应用程序。我有一个原始的SQL脚本需要种子数据库。如果我进入一个SQL shell并运行该命令,它可以正常工作。当我从Flask运行它时,我得到一个错误:
(1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DROP TABLE IF EXISTS board_symbol; \n DROP T
C:\eb-virt\bucketlist>pip install flask-mysql
Using cached Flask_MySQL-1.3-py2.py3-none-any.whl Using cached MySQL-python-1.2.5.zipRequirement already satisfied (use --upgrade to upgrade): Flask in c
在虚拟环境中安装所有的东西,然后使用pip install flask-mysql安装烧瓶-mysql。我的笔尖冻结显示:Flask==1.0.2itsdangerous==1.1.0MarkupSafe==1.1.0PyMySQL==0.9.3在安装Flask-MySQL之后,我通过尝试以下不同版本的"from“命令(在python提示符下)来测试安装:
from flask.ext.mysql