修补数据库安装脚本未指定端口问题
This commit is contained in:
+4
-1
@@ -1,4 +1,5 @@
|
||||
import sys
|
||||
|
||||
sys.path.append('../')
|
||||
import sqlparse
|
||||
import pymysql
|
||||
@@ -24,7 +25,8 @@ def init_database():
|
||||
|
||||
|
||||
def execute_fromfile(filename):
|
||||
db = pymysql.connect(host=HOST, user=USERNAME, password=PASSWORD, database=DATABASE, charset='utf8mb4')
|
||||
db = pymysql.connect(host=HOST, port=int(PORT), user=USERNAME, password=PASSWORD, database=DATABASE,
|
||||
charset='utf8mb4')
|
||||
fd = open(filename, 'r', encoding='utf-8')
|
||||
cursor = db.cursor()
|
||||
sqlfile = fd.read()
|
||||
@@ -53,5 +55,6 @@ def init_db():
|
||||
print('表创建成功')
|
||||
print('欢迎使用pear-admin-flask,请使用 flask run 命令启动程序')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
init_db()
|
||||
|
||||
Reference in New Issue
Block a user