Guest User

Untitled

a guest
Oct 2nd, 2020
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | None | 0 0
  1. import pymysql
  2.  
  3. connect_args = {
  4.     "host": "192.168.0.7",
  5.     "user": "User",
  6.     "password": "PW",
  7.     "db": "DBName",
  8.     "charset": "utf8mb4"
  9. }
  10. cnxn = pymysql.connect(**connect_args)
  11. crsr = cnxn.cursor()
  12. crsr.execute("SELECT 'Hello World!' AS hello")
  13. print(crsr.fetchone())
  14.  
Advertisement
Add Comment
Please, Sign In to add comment