MySQL Connector/Python Developer Guide

10.2.45 MySQLConnection.server_host Property

This read-only property returns the host name or IP address used for connecting to the MySQL server.

Returns a string.