Thursday, February 13, 2020

How to connect phpmyadmin mysql with python


import pymysql

conn=pymysql.connect(host="localhost",user="root",password="",db="my_python")
mycursor=conn.cursor()
mycursor.execute("""CREATE TABLE names
            (id int primary key,
            name varchar(20)
            )               
            """)
conn.commit()
conn.close()

output:

No comments:

Post a Comment

python class topic video