unix_socket

Overview

This connection value (read-only) returns the path of the unix socket that was used for the connection or None if the connection was made via IP.

See also: MariaDB Connector/Python 1.1 and in 1.0

EXAMPLES

import mariadb

conn = mariadb.connect(
    host = 'localhost',
    user = 'root',
    password = 'secret',
    )

print(conn.unix_socket) # May print: None
# ... or something like: /var/run/mysqld/mysqld.sock

CHANGE HISTORY

Release Series

History

1.1

  • Present starting in MariaDB Connector/Python 1.1.0rc1.

1.0

  • Present starting in MariaDB Connector/Python 1.0.0.