This page describes an upcoming change (September 1, 2026) for customers who use Python to connect to PlanetScale Vitess databases.
PlanetScale is deploying a protocol fix to Vitess that may result in timeouts in Python applications. To avoid problems, explicitly configure autocommit by adding autocommit=True or init_command="set autocommit=0" to your connect arguments.
This change affects Python apps that connect to PlanetScale Vitess using SQLAlchemy, PyMySQL, asyncmy, or aiomysql and do not explicitly configure autocommit.
Recommended adjustments
Make one of the following adjustments so that your connections have a consistent autocommit setting before and after the Vitess change is deployed.
Option A: Set autocommit=True
Add autocommit=True to your connect arguments. This is recommended if you are relying on default behavior. This setting ensures that your application continues running in the same mode after PlanetScale rolls out the Vitess change.
Option B: Set init_command="set autocommit=0"
Add init_command="set autocommit=0" to your connect arguments. This is recommended if your app manages all SQL queries with transactions or if it keeps connections open for less than 20 seconds.
SQLAlchemy
PyMySQL
asyncmy
aiomysql
Additional context
PlanetScale is changing Vitess so that it reports the correct autocommit value during the initial handshake packet. Some Python MySQL drivers (PyMySQL, asyncmy, aiomysql) use that initial handshake packet to decide the connection’s autocommit behavior. Other Python MySQL drivers (mysql-connector-python, mysqlclient) and MySQL client libraries in other languages do not rely solely on the initial handshake packet and are not affected by the issue described below.
Because of the current Vitess behavior, the affected Python clients create connections configured with autocommit on, which is inconsistent with their intent to have autocommit off. After PlanetScale deploys the change, apps that use the client’s default (autocommit=False) begin correctly running with autocommit off.
After the change, any clients with implicit autocommit=False intent begin to observe actual autocommit=False behavior. In this mode, statements that are outside of an explicit transaction start an implicit transaction and the implicit transaction stays open. The implicit transaction follows the same timeout rules as any other transaction, which means it times out if it is not committed or rolled back within 20 seconds.
In other words, if you run the equivalent of execute("SELECT 1"); sleep 21; execute("SELECT 1") today, it works. After the change, the second query returns a transaction timeout error.
Questions
If you need guidance, contact PlanetScale Support with your Python client library, version, and connection setup code.
Need help?
Get help from the PlanetScale Support team, or join our Discord community to see how others are using PlanetScale.