29 lines
965 B
Python
29 lines
965 B
Python
#!/usr/bin/env python3
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import os
|
|
from datetime import datetime
|
|
import mysql.connector
|
|
from dotenv import load_dotenv
|
|
from pathlib import Path
|
|
|
|
# Always load .env from the folder where THIS script is stored
|
|
env_path = Path(__file__).resolve().parent / ".env"
|
|
load_dotenv(env_path)
|
|
|
|
# =======================
|
|
# ENV DEBUG OUTPUT
|
|
# =======================
|
|
print("======================================")
|
|
print("ENV DEBUG")
|
|
print("Script file:", __file__)
|
|
print("Script folder:", Path(__file__).resolve().parent)
|
|
print("Expected .env path:", env_path)
|
|
print(".env exists? ->", env_path.exists())
|
|
print("Current working directory (cwd):", os.getcwd())
|
|
print("Loaded DB_MYSQL_HOST:", os.getenv("DB_MYSQL_HOST"))
|
|
print("Loaded DB_MYSQL_PORT:", os.getenv("DB_MYSQL_PORT"))
|
|
print("Loaded DB_MYSQL_ROOT:", os.getenv("DB_MYSQL_ROOT"))
|
|
print("Loaded DB_MYSQL_ROOT_PASS:", os.getenv("DB_MYSQL_ROOT_PASS"))
|
|
print("======================================")
|