sanjay555

Untitled

Jun 22nd, 2017
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3. import pymysql
  4.  
  5. conn = pymysql.connect(host='localhost', port=3306, user='root', passwd='', db='sandbox')
  6.  
  7. cur = conn.cursor()
  8. cur.execute("SELECT * FROM users")
  9.  
  10. print(cur.description)
  11. print()
  12.  
  13. for row in cur:
  14.     print(row)
  15.  
  16. cur.close()
  17. conn.close()
Add Comment
Please, Sign In to add comment