if you are using MySQL shell
xxxxxxxxxx
\status
also use \? or \help when you need help
xxxxxxxxxx
import mysql.connector
# Replace 'username', 'password', and 'database_name' with your MySQL credentials
mydb = mysql.connector.connect(
host="localhost",
user="username",
password="password",
database="database_name"
)
mycursor = mydb.cursor()
mycursor.execute("SELECT VERSION()")
result = mycursor.fetchone()
print("MySQL version: ", result)