MySQL.connect()
Connects to the MySQL database engine represented by the various connection keyword/value parameters. These parameters include:
host
The name of the server on which the MySQL database is running
user
The user ID for connecting to MySQL. MySQL should allow this user to make the connection.
passwd
The password to authenticate the user ID for the connection.
db
The MySQL database to which the application attempts to connect.
port
Directs MySQLdb to connect to a MySQL installation on a custom part. When left unspecified, the method will use the default MySQL port of 3306.
unix_socket
Identifies the location of a socket or named pipe to use if the host allows it.
client_flags
An integer specifying the client connection flags to use. These
client connection flags are the same ones enumerated in Chapter 19 for the mysql_real_connect(
)
method.
This method returns a Python object representing a connection to a MySQL database.