build.utils.db_api.creat_db   A
last analyzed

Complexity

Total Complexity 0

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 0
eloc 10
dl 0
loc 28
rs 10
c 0
b 0
f 0
1
# -*- coding: utf-8 -*-
2
3
4
from data import config
5
import mysql.connector
6
import logging
7
8
9
"""
10
11
12
    Created on 24.09.2021
13
    
14
    @author: Nikita
15
16
17
"""
18
19
20
db = mysql.connector.connect(host=config.host,
21
                             database=config.database,
22
                             user=config.user,
23
                             password=config.password)
24
25
cursor = db.cursor()
26
27
logging.info('The connection to the database is established!')
28