from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker

# 数据库地址
HOSTNAME = '192.168.5.226'
# 端口号
PORT = '3308'
# 库名
DATABASE = 'wzxphoto'
# 用户名
USERNAME = 'root'
# 密码
PASSWORD = 'test9Root'
# 把配置信息和以上的连接数据组合
DB_URL = f'mysql+pymysql://{USERNAME}:{PASSWORD}@{HOSTNAME}:{PORT}/{DATABASE}'

# 是否打印执行的sql
SHOW_SQL = False

Engine = create_engine(DB_URL, echo=SHOW_SQL)
Base = declarative_base(Engine)
MysqlSession = sessionmaker(bind=Engine)
