- @bukakoding
-
Joined
Nov 6, 2024
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
conn = mysql.connector.connect( | |
host="root", | |
user="myuser", | |
password="mypassword" | |
) | |
except Exception as e: | |
print("cannot connect database", e) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"database/sql" | |
"fmt" | |
"log" | |
_ "github.com/go-sql-driver/mysql" | |
) |