Database connection test to MySQL

#username of MySQL: root

#Password: root

#Hostname: localhost

# Database Name in MySQL: test

import mysql.connector

x = mysql.connector.connect(user='root', password='root',host='localhost',database='test')

x.close()

No comments: