import mysql.connector

# Database configuration
config = {
    'user': 'naynabco_sg',
    'password': '7DBhU@l]2Z;E',
    'host': '138.201.140.197',
    'port': '3306',
    'database': 'naynabco_sgdata',
}

try:
    # Connect to the database
    connection = mysql.connector.connect(**config)
    print("Successfully connected to the database!")

    # Close the connection
    connection.close()
except mysql.connector.Error as error:
    print("Error:", error)
