Generate Python code to connect to a SQL database.
hostname: test.com,
username: admin,
password: pwd123
import mysql.connector

connection = mysql.connector.connect(  
    host = "test.com",
    user = "admin",
    password = "pwd123",
    database = "testdb"
)