Created
March 23, 2018 13:14
-
-
Save rbk/109aacf125eee63bdcc14999973141c3 to your computer and use it in GitHub Desktop.
Connect to MySQL via PyMysql
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pymysql | |
connection = pymysql.connect(host='<ip-or-domain>', | |
user='<dbuser>', | |
password='<dbpass>', | |
db='<dbname>', | |
charset='utf8mb4', | |
cursorclass=pymysql.cursors.DictCursor, | |
autocommit=True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment