python connection database

step:

1. Connect to the database account password ip port number Database 
2. Create a cursor
3. Execute sql
4. Get the result
5. Close the cursor
6. The connection is closed

Example:

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325236352&siteId=291194637