Advertisement
Guest User

Untitled

a guest
Apr 21st, 2017
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. # note: Must install pymysql: `pip3 install pymysql`
  2. import pymysql
  3. conn= pymysql.connect(host='localhost',user='root',password='password',db='s1',charset='utf8mb4',cursorclass=pymysql.cursors.DictCursor)
  4. a=conn.cursor()
  5. sql='CREATE TABLE `users` (`id` int(11) NOT NULL AUTO_INCREMENT,`email` varchar(255) NOT NULL,`password` varchar(255) NOT NULL,PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;'
  6. a.execute(sql)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement