DB-Skript
This commit is contained in:
		
							
								
								
									
										33
									
								
								dbcreate.sql
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										33
									
								
								dbcreate.sql
									
									
									
									
									
										Normal file
									
								
							| @@ -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 */; | ||||
							
								
								
									
										2
									
								
								wstat.py
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								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='<passwort>',database='weather') | ||||
| mycursor = mydb.cursor() | ||||
|  | ||||
| print(mydb) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Olli Graf
					Olli Graf