-
Notifications
You must be signed in to change notification settings - Fork 274
New issue
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
Fix "mysql server has gone away" in mysql cache backend #34
Comments
I got same thing using Flask with SQLAlchemy before. http://stackoverflow.com/questions/16341911/sqlalchemy-error-mysql-server-has-gone-away |
Hi, @lorien I drop this file into some project, example: and init db in app: from db import db_session, init_db
SQLALCHEMY_DATABASE_URI = "mysql+mysqldb://%s:%s@%s/%s?charset=utf8" % (db_user, db_pass, db_host, db_name)
init_db(SQLALCHEMY_DATABASE_URI)
...
...
db_session.add(Model)
db_session.commit() And Model: from sqlalchemy import (
Column,
Integer,
)
from db import Base
class User(Base):
"""User Model"""
__tablename__ = 'users'
id = Column(Integer, primary_key=True) |
«Patch» action log: |
Пожалуй, закрою этот тикет, так как я его сам открывал, а фунциональность эта мне уже сто лет как не нужна. |
How to repeat:
The text was updated successfully, but these errors were encountered: