I am in the need of saving data into a MySQL database, my problem is I can\'t find the package...
Solution explored:
Oracle website: https://dev.mysql.c
mysqlclient
supports python3.7
officially, you can find it here :
https://pypi.python.org/pypi/mysqlclient
1)you can download , PyMySQL 0.9.2
2)extract & copy the folder pymysql
into the python Lib
folder
3)and for connection you can do like this(make a file for example freeman.py
):
#!/usr/bin/env python
import pymysql
conn = pymysql.connect(host='localhost', port=3306, user='root', passwd='', db='freemanDB')
cur = conn.cursor()
cur.execute("SELECT * FROM users")
print(cur.description)
print()
for row in cur:
print(row)
cur.close()
conn.close()