# pymysql

import pymysql
database = {
    'host':'maria',
    'database':'pythonrepo',
    'user':'root',
    'password':'666666',
    'charset':'utf8'
}
db = pymysql.connect(**database)
cursor = db.cursor();
cursor.execute("insert into test(name) values(%s)",("李四"))
cursor.execute("delete from test where name ='李四'")
cursor.execute("update test set name='张三' where id=2")
db.commit()
cursor.execute("select * from test")
result = cursor.fetchall()
for row in result:
    print(row)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18