mock_s3 interfering SQLAlchemy calls to local MySQL databases
See original GitHub issuePlease consider the below code snippet.
#!/usr/bin/env python
from sqlalchemy import create_engine
from sqlalchemy_utils import database_exists
from moto import mock_s3
@mock_s3
def test_foob():
database_exists("mysql+pymysql://user:password@127.0.0.1")
If we run this with pytests, it will fail with the below error.
sqlalchemy.exc.OperationalError: (pymysql.err.OperationalError) (2013, 'Lost connection to MySQL server during query')
However, if we remove the @mock_s3
decorator, it passes. Any idea why this is happening?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:6 (2 by maintainers)
Top Results From Across the Web
SQLAlchemy can't connect to local MySQL - Stack Overflow
your MySQL server's socket is likely not at /tmp/mysql.sock so the driver can't connect. Mine is at /var/run/mysqld/mysqld.sock, ...
Read more >MySQL and MariaDB — SQLAlchemy 2.0 Documentation
Upon first connect, the SQLAlchemy dialect employs a server version detection scheme that determines if the backing database reports as MariaDB.
Read more >Using SQLAlchemy to access MySQL without frustrating ...
This library has a number of problems: 1) it is Python 2 only, and 2) it requires compiling against the MySQL C library...
Read more >Connect to MySQL with SQLAlchemy - In Plain English
In this article, you'll learn how to connect to a database with SQLAlchemy. Furthermore, you'll see some examples, which should get you ...
Read more >SQLAlchemy Tutorial 1 – Connect Python to MySQL ...
This video is a step by step tutorial on how to connect Python to various database engines including MySQL, SQLite and PostgreSQL and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Great, thanks for opening the issue!
master
looks good to me!(in python3.4)