Created
March 28, 2020 13:30
-
-
Save adrianblade/85014c07339c8726bf63a8b0523b94b3 to your computer and use it in GitHub Desktop.
This file contains 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 mysql | |
from getpass import getpass | |
db = mysql.connect( | |
host="localhost", | |
user="root", | |
password=getpass("Password: "), | |
database="my_db_name" | |
) | |
conn = db.cursor() | |
conn.execute("select * from A") | |
result = conn.fetchall() | |
print(result) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment