Breaking

Search Here

Saturday, July 25, 2020

How to connect mysql workbench using python in jupyter notebook anaconda

How to connect mysql workbench using python in jupyter notebook anaconda

How to connect mysql workbench using python in jupyter notebook anaconda
tutorial:

Script:- 

conda install -c anaconda mysql-connector-python

import mysql.connector

mydb=mysql.connector.connect(host='localhost',user='root',password='your_password',database='tutorial',use_pure=True)

mycursor=mydb.cursor()

mycursor.execute('CREATE TABLE customer(name VARCHAR(25))')

mycursor.execute('SHOW TABLES')
for x in mycursor:

    print(x)

No comments:

Post a Comment