When i am using mysql.connector library to connect mysql local database with my python programme and when i am running it there is no out in my shell .What should i do please help.
This my code:
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()
OUTPUT:
=========== RESTART: C:\user\main.py ===========
=========== RESTART: Shell ======================
- mysql version:8.0.40
- python version:3.13.0
- os : windows 10
i tried to run programme and there was no output.