mysql giving deprecated warning

I got the error while using pymysql library in a flask setup. Downgrading to mysql 5.6 works but maybe not the best solution.


From MySQL 5.7.20 onwards you should changeover to using transaction_isolation. In documentation it states:

Prior to MySQL 5.7.20, use tx_isolation rather than transaction_isolation.

https://dev.mysql.com/doc/refman/5.7/en/set-transaction.html

tx_isolation

Deprecated  5.7.20
System Variable Name    tx_isolation

https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_tx_isolation

transaction_isolation

Command-Line Format         --transaction-isolation=name
System Variable (>= 5.7.20) Name    transaction_isolation

https://dev.mysql.com/doc/refman/5.7/en/server-system-variables.html#sysvar_transaction_isolation

EDIT:

Instead of relying on the old variable, start using the new variable, as in the examples provided by the documentation

SELECT @@GLOBAL.transaction_isolation, @@transaction_isolation; 
SET GLOBAL transaction_isolation='REPEATABLE-READ'; 
SET SESSION transaction_isolation='SERIALIZABLE';

You will have to search through your code to identify where the deprecated variable has been used, and substitute it with the new variable/syntax.


The problem is resolved in SQLAlchemy, released as a part of version 1.2.0, backported to 1.1.15 and it was rolled out 2017-11-03. By upgrading SQLAlchemy to 1.1.15 the warning disappears.

pip install sqlalchemy>=1.1.15

Tags:

Mysql