0

I have a piece of code that used to work fine until very recently:

from sqlalchemy import create_engine

engine = create_engine(
      'mysql+mysqldb://{}:{}@{}/{}'.format(
          user,
          password,
          hostname,
          database),
      echo=False,
      pool_recycle=300) # re-connect after 5 minutes

connection = engine.connect()

Now, it fails immediately with a segmentation fault. Has the syntax changed?

The server runs MySQL 5.7.19 and is definitely responding. My installation is sqlalchemy-1.2.4 and mysql-python-1.2.5. I'm using python 2.7.14.

Thanks for any help.

1 Answer 1

2

I have found a workaround using pymysql instead of mysqldb:

engine = create_engine(
      'mysql+pymysql://{}:{}@{}/{}'.format(
          user,
          password,
          hostname,
          database),
      echo=False,
      pool_recycle=300)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.