test.py hinzugefügt
This commit is contained in:
13
test.py
Normal file
13
test.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from sqlalchemy import create_engine, text
|
||||
|
||||
# Verbindung anpassen:
|
||||
DATABASE_URL = "mysql://mariadb:r5WdORhRYOajNZ9lcn1raCWpXAhQa1v6sM5xN8JEffr2rZLDhQvAGQVfcj6f7rzf@tkgo4k84c8wgcos40kgs8ows:3306/default"
|
||||
|
||||
try:
|
||||
engine = create_engine(DATABASE_URL)
|
||||
with engine.connect() as connection:
|
||||
result = connection.execute(text("SELECT VERSION()"))
|
||||
version = result.fetchone()
|
||||
print("Verbindung erfolgreich. MariaDB-Version:", version[0])
|
||||
except Exception as e:
|
||||
print("Fehler bei der Verbindung:", e)
|
||||
Reference in New Issue
Block a user