diff --git a/dbcreate.sql b/dbcreate.sql new file mode 100644 index 0000000..e8b555b --- /dev/null +++ b/dbcreate.sql @@ -0,0 +1,33 @@ +-- MariaDB dump 10.19 Distrib 10.11.3-MariaDB, for debian-linux-gnu (x86_64) +-- +-- Host: database Database: weather +-- ------------------------------------------------------ +-- Server version 10.6.12-MariaDB-log + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8mb4 */; +/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; +/*!40103 SET TIME_ZONE='+00:00' */; +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; +/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; + +-- +-- Table structure for table `stats` +-- + +DROP TABLE IF EXISTS `stats`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `stats` ( + `id` int(11) NOT NULL AUTO_INCREMENT, + `datum` datetime DEFAULT NULL, + `temperature` float DEFAULT NULL, + `humidity` float DEFAULT NULL, + `pressure` float DEFAULT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=683349 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci; +/*!40101 SET character_set_client = @saved_cs_client */; diff --git a/wstat.py b/wstat.py index eaa5a31..0991f8b 100755 --- a/wstat.py +++ b/wstat.py @@ -20,7 +20,7 @@ bus = smbus2.SMBus(port) calibration_params = bme280.load_calibration_params(bus, adresse) # Datenbankverbindung herstellen. -mydb = mysql.connector.connect(host='database', user='ploeger',password='SW_Ep.6:ROTJ',database='weather') +mydb = mysql.connector.connect(host='database', user='ploeger',password='',database='weather') mycursor = mydb.cursor() print(mydb)