]>
Commit | Line | Data |
---|---|---|
1 | import mysql.connector as mysql | |
2 | from base import Base | |
3 | ||
4 | class Mysql(Base): | |
5 | def __init__(self, database, user, password, host, port): | |
6 | if port is None: | |
7 | port = 3306 | |
8 | try: | |
9 | self.conn = mysql.connect(database=database, user=user, password=password, host=host, port=port) | |
10 | except mysql.Error as e: | |
11 | raise Exception(e) |