blob: 16595d3972d6bd6dadf0815c4d3a4e0c63482ef0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
import json
import mysql.connector
settings = json.load(file('config/db.json'))
connection = mysql.connector.connect(
user=settings['user'],
password=settings['pass'],
host=settings['host'],
port=settings['port'],
database=settings['db']
)
cursor = connection.cursor(dictionary=True, buffered=True)
|