flask SQLAlchemy pymysql 连接数据库

SQLite

sqlite:///database.db

MySQL

mysql+pymysql://user:password@ip:port/db_name

Postgres

postgresql+psycopg2://user:password@ip:port/db_name

MSSQL

mssql+pyodbc://user:password@dsn_name

Oracle

oracle+cx_oracle://user:password@ip:port/db_name

----

class  DevConfig(Config):

  debug=True

  SQLALCHEMY_DATABASE_URI="Your_uri"

 

posted @ 2018-08-19 18:59  duxiao123  阅读(557)  评论(0编辑  收藏  举报