Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

connect python to mysql

import mysql.connector
mydb = mysql.connector.connect(
  host="localhost",
  user="yourusername",
  password="yourpassword",
  port = 8888, #for Mamp users
  database='whatever db you want'
)
print(mydb) 
 
PREVIOUS NEXT
Tagged: #connect #python #mysql
ADD COMMENT
Topic
Name
3+2 =