Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

#connecting to mysql db

import pymysql
conn = pymysql.connect(host='localhost' , database='world' , user='root',
password='password') #conection string in api documents

cursor = conn.cursor()
cursor.execute('select *from emptab1')
rows = cursor.fetchall()
print(rows)

cursor.close()
conn.close()

You might also like