change_user()

Overview

Changes the user and default database of the current connection. A valid username and password pair must be provided and that user must have sufficient permissions to access the desired database. If for any reason authorization fails, the current user authentication will remain.

See also: MariaDB Connector/Python 1.1 and in 1.0

EXAMPLES

import mariadb

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

conn.change_user('joe', 'secret2', 'test_table')

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.