pymysql.connect()
Description
This method creates a database session and returns a new connection object.
Prototype
conn=pymysql.connect(database="databasename",user="username",password="********",host="127.0.0.1",port=portnum)
Parameters
|
Keyword |
Description |
|---|---|
|
database |
Database name. |
|
user |
Username. |
|
password |
Password. |
|
host |
IP address of the database. |
|
port |
Connection port number. |
|
ssl_disabled |
Specifies whether to enable SSL on the client. The default value is None. |
|
ssl_ca |
Client CA root certificate, which is used for SSL connection. |
|
ssl_cert |
Path of the client certificate, which is used for SSL connection. |
|
ssl_key |
Path of the client key, which is used for SSL connection. |
|
charset |
Encoding format of the client. |
|
autocommit |
Autocommit mode. The default value is False. |
Return Value
Connection object (for connecting to a database instance)
Examples
For details, see Examples: Common Operations.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot