Это мой код:
Код: Выделить всё
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()
Код: Выделить всё
=========== RESTART: C:\user\main.py ===========
=========== RESTART: Shell ======================
- Версия MySQL: 8.0.40
- Версия Python: 3.13.0
< li>os: windows 10
Подробнее здесь: https://stackoverflow.com/questions/791 ... -programme
Мобильная версия