MySQL Connection Fix

This commit is contained in:
İsmail
2024-11-06 14:45:00 +03:00
parent c00f48083e
commit c8fde8d2ad

View File

@@ -39,24 +39,17 @@ func CreateMyDB() (func(), error) {
ctx := context.Background()
c, err := mysql.Run(ctx,
"mysql:8.0.36",
mysql.WithDatabase("foo"),
mysql.WithUsername("root"),
mysql.WithPassword(""),
testcontainers.WithWaitStrategy(
wait.ForLog("database system is ready to accept connections").
WithOccurrence(1).WithStartupTimeout(30*time.Second)),
"mysql:8.0.40",
mysql.WithDatabase("netbird"),
mysql.WithUsername("netbird"),
mysql.WithPassword("mysql"),
)
log.Printf("[DEBUG] CreateMyDB - 2")
if err != nil {
log.Printf("[DEBUG] CreateMyDB Error: %s", err)
return nil, err
}
log.Printf("[DEBUG] CreateMyDB - 3")
talksConn, err := c.ConnectionString(ctx)
log.Printf("[DEBUG] CreateMyDB - ConnectionString: %s, Error: %s", talksConn, err)