Last active
January 27, 2021 07:36
-
-
Save vijayakumarchinthala/f887bb63e7bd05fbc57f564e4c1909c2 to your computer and use it in GitHub Desktop.
mysql with python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import mysql.connector as sqltor | |
| mycon=sqltor.connect(host="localhost",user="root",passwd="tiger",database="gvkcv") | |
| if mycon.is_connected()==False: | |
| print("error connecting to database") | |
| cursor=mycon.cursor() | |
| cursor.execute("select *from student10") | |
| data=cursor.fetchall() | |
| for i in data: | |
| print(i) | |
| mycon.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment