Skip to content

Instantly share code, notes, and snippets.

@adrianblade
Created March 28, 2020 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adrianblade/85014c07339c8726bf63a8b0523b94b3 to your computer and use it in GitHub Desktop.
Save adrianblade/85014c07339c8726bf63a8b0523b94b3 to your computer and use it in GitHub Desktop.
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