Das ist mein Code:
Code: Select all
import mysql.connector
# Establish the connection
connection = mysql.connector.connect(
host="localhost",
user=`your text`"root",
password="password"
)
# Check if the connection was successful
if connection.is_connected():
print("Connection to MySQL DB successful")
else:
print("Connection failed")
# Close the connection
connection.close()
Code: Select all
=========== RESTART: C:\user\main.py ===========
=========== RESTART: Shell ======================
- MySQL-Version:8.0.40
- Python-Version:3.13.0
- Betriebssystem: Windows 10
Mobile version