diff --git a/connect.py b/connect.py new file mode 100644 index 0000000..654c4a6 --- /dev/null +++ b/connect.py @@ -0,0 +1,6 @@ +import pymysql + +def connect(): + conn = pymysql.connect(host='localhost', user='root', password='zouzhenyu2003', database='library') + cursor = conn.cursor() + return cursor, conn