Start
This commit is contained in:
12
Dev/mysql_switch_fw/.env
Normal file
12
Dev/mysql_switch_fw/.env
Normal file
@@ -0,0 +1,12 @@
|
||||
# Docker-Compose Environment Variables for MySQL
|
||||
|
||||
# Path for MySQL data storage on the host machine
|
||||
# Az adatbázis adatai a 'Dev/mysql/data' mappába kerülnek mentésre.
|
||||
# Ezt az elérési utat tetszés szerint módosíthatod.
|
||||
MYSQL_DATA_PATH=./data
|
||||
|
||||
# MySQL Credentials
|
||||
MYSQL_ROOT_PASSWORD=virgI6774
|
||||
MYSQL_DATABASE=switch_fw
|
||||
MYSQL_USER=switchfw
|
||||
MYSQL_PASSWORD=virgI6774
|
||||
17
Dev/mysql_switch_fw/CREATE TABLE switches_fw.md
Normal file
17
Dev/mysql_switch_fw/CREATE TABLE switches_fw.md
Normal file
@@ -0,0 +1,17 @@
|
||||
CREATE TABLE switches (
|
||||
id INT AUTO_INCREMENT PRIMARY KEY,
|
||||
switch_name VARCHAR(255) NOT NULL COMMENT 'A switch hosztneve vagy azonosítója',
|
||||
ip_address VARCHAR(45) NOT NULL COMMENT 'A switch IP címe (IPv4 vagy IPv6)',
|
||||
firmware_version VARCHAR(255) NOT NULL COMMENT 'A switch firmware verziója',
|
||||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT 'A rekord létrehozásának időpontja',
|
||||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'A rekord utolsó frissítésének időpontja'
|
||||
) COMMENT='Aruba switchek firmware verzióinak tárolása';
|
||||
|
||||
Magyarázat:
|
||||
|
||||
* id INT AUTO_INCREMENT PRIMARY KEY: Egy automatikusan növekvő egész szám, amely egyedi azonosítóként szolgál minden rekordhoz.
|
||||
* switch_name VARCHAR(255) NOT NULL: A switch nevét tárolja, maximum 255 karakter hosszúságban, és nem lehet üres.
|
||||
* ip_address VARCHAR(45) NOT NULL: A switch IP címét tárolja, ami IPv4 (max 15 kar.) és IPv6 (max 45 kar.) címekhez is elegendő, és nem lehet üres.
|
||||
* firmware_version VARCHAR(255) NOT NULL: A firmware verziószámát tárolja, maximum 255 karakter hosszúságban, és nem lehet üres.
|
||||
* created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP: Automatikusan beállítja a rekord létrehozásának időpontját.
|
||||
* updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP: Automatikusan frissül a rekord minden módosításakor az aktuális időpontra.
|
||||
25
Dev/mysql_switch_fw/README.md
Normal file
25
Dev/mysql_switch_fw/README.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# MySQL Docker Container
|
||||
|
||||
This directory contains the configuration for running MySQL in a Docker container.
|
||||
|
||||
## Configuration
|
||||
|
||||
The configuration is managed through the `.env` file. You can change the following variables:
|
||||
|
||||
- `MYSQL_DATA_PATH`: The local directory where the database data will be stored. By default, it's set to `./data` within this directory.
|
||||
- `MYSQL_ROOT_PASSWORD`: The root password for the MySQL instance.
|
||||
- `MYSQL_DATABASE`: The name of the database to be created on startup.
|
||||
- `MYSQL_USER`: The username for a non-root user.
|
||||
- `MYSQL_PASSWORD`: The password for the non-root user.
|
||||
|
||||
## Usage
|
||||
|
||||
To start the container, navigate to this directory (`Dev/mysql`) and run the following command:
|
||||
```bash
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
To stop the container:
|
||||
```bash
|
||||
docker-compose down
|
||||
```
|
||||
23
Dev/mysql_switch_fw/docker-compose.yml
Normal file
23
Dev/mysql_switch_fw/docker-compose.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
mysql_fw:
|
||||
image: mysql:latest
|
||||
container_name: mysql_fw_db
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
|
||||
MYSQL_DATABASE: ${MYSQL_DATABASE}
|
||||
MYSQL_USER: ${MYSQL_USER}
|
||||
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
|
||||
ports:
|
||||
- '3306:3306'
|
||||
volumes:
|
||||
- /mnt/c/Tools/Docker/mysql_sw_fw:/var/lib/mysql
|
||||
networks:
|
||||
- shared-network
|
||||
|
||||
networks:
|
||||
shared-network:
|
||||
external: true
|
||||
|
||||
3
Dev/mysql_switch_fw/my-custom.cnf
Normal file
3
Dev/mysql_switch_fw/my-custom.cnf
Normal file
@@ -0,0 +1,3 @@
|
||||
[mysqld]
|
||||
default-authentication-plugin=mysql_native_password
|
||||
default-time-zone='+01:00'
|
||||
Reference in New Issue
Block a user