Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class database_creator():
- def __init__(self , username , password):
- self.username = username
- self.password = password
- self.cursor = None # this is the cursor
- self.connect = None # this is the cnx the mysql object
- self.tables = [] # this shows how many databse table are there
- def initializer(self): # sets the cursor and starts the engine
- self.connect = mysql.connector.connect(user=self.username, password= self.password)
- self.cursor = self.connect.cursor()
- def connect (self , c_database ):
- # c_database is the name of the database that i want to make
- self.cursor.execute("CREATE DATABASE(c_database)")
- self.connect.database = c_database #
Add Comment
Please, Sign In to add comment