MySQL Connector/Python Developer Guide

10.2.49 MySQLConnection.server_info Property

This read-only property returns the MySQL server information verbatim as a string: for example 8.4.0-log, or None when not connected.