Lesson - 55 : Python Advanced - Python Database Access : MySQL Insert Data

preview_player
Показать описание
**************************************************
**************************************************

Python Database Access : MySQL Insert Data:

To insert new rows into a MySQL table, you follow the steps below:
1. Connect to the MySQL database server by creating a new MySQLConnection object.
2. Initiate a MySQLCursor object from the MySQLConnection object.
3. Execute the INSERT statement to insert data into the intended table.
4. Close the database connection.
MySQL Connector/Python provides API that allows you to insert one or many rows into a table at a time. Let’s examine at each method in more detail.
Insert one row into a table:
db_config = read_db_config()
        conn = MySQLConnection(**db_config)
 

Insert multiple row into a table:

Рекомендации по теме
visit shbcf.ru