Browse Source

working directory db

develop
Olli Graf 2 years ago
parent
commit
67c7d20b1b
  1. 3
      db/.gitignore
  2. 10
      db/connectdb.py

3
db/.gitignore

@ -0,0 +1,3 @@
./__pycache__
*.log
./network/__pycache__/*

10
db/connectdb.py

@ -0,0 +1,10 @@
import mysql.connector
import logging
logging.basicConfig( format='%(asctime)-15s [%(levelname)s] %(funcName)s: %(message)s', level=logging.DEBUG)
mydb = mysql.connector.connect(host='database', user='ploeger',password='SW_Ep.6:ROTJ',database='weather')
logging.debug(f'Datenbankverbindung aufgebaut ${mydb}')
mycursor = mydb.cursor()
logging.debug(f'Cursor gesetzt ${mycursor}')
Loading…
Cancel
Save