Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pymysql
- connect_args = {
- "host": "192.168.0.7",
- "user": "User",
- "password": "PW",
- "db": "DBName",
- "charset": "utf8mb4"
- }
- cnxn = pymysql.connect(**connect_args)
- crsr = cnxn.cursor()
- crsr.execute("SELECT 'Hello World!' AS hello")
- print(crsr.fetchone())
Advertisement
Add Comment
Please, Sign In to add comment