Advertisement
KodingKid

How to create a Python Database

Apr 2nd, 2021
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.36 KB | None | 0 0
  1. import mysql.connector
  2. mydb = mysql.connector.connect(
  3.   host="host",
  4.   user="username",
  5.   password="password"
  6. )
  7. mycursor = mydb.cursor()
  8. mycursor.execute("CREATE DATABASE database")
  9. #this is how you create a database in python
  10. #see also: https://pastebin.com/q4Ubsd71 - https://pastebin.com/JJ0ueBiD - https://pastebin.com/hxCDvCpx - https://pastebin.com/bf6VBk4X
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement