View in Telegram
👩‍💻تکه‌کد اتصال به پایگاه داده MySql ⚠️این تکه‌ کد برای اتصال به MySql می‌باشد ⚠️این تکه کد به زبان 🎲 نوشته شده است 🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦
import mysql.connector
from mysql.connector import Error

dataBase = {
    'name': 'HeroExpert',  # DbName
    'userName': 'root',  # DbUserName
    'passWord': 'HeRo'  # DbPassword
}

try:
    connection = mysql.connector.connect(
        host='localhost',
        database=dataBase['name'],
        user=dataBase['userName'],
        password=dataBase['passWord']
    )
    
    if connection.is_connected():
        print("Connecting Successfully")

except Error as e:
    print("Connect Failed: ", e)

finally:
    if 'connection' in locals() and connection.is_connected():
        connection.close()
        print("Connection closed.")
🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦🟦 ⚡️ @HeroExpert_ir | کارشناس قهرمان
Please open Telegram to view this post
VIEW IN TELEGRAM
Love Center - Dating, Friends & Matches, NY, LA, Dubai, Global
Love Center - Dating, Friends & Matches, NY, LA, Dubai, Global
Find friends or serious relationships easily