Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mysql 5.7 not supported? #1502

Closed
clarkk opened this issue Oct 21, 2023 · 1 comment
Closed

mysql 5.7 not supported? #1502

clarkk opened this issue Oct 21, 2023 · 1 comment

Comments

@clarkk
Copy link

clarkk commented Oct 21, 2023

When connecting to mysql 8 it works, but can't connect to mysql 5.7

import (
	"database/sql"
	_ "github.com/go-sql-driver/mysql"
)

var dsn = "root:xxx@/mydb?charset=utf8"

	var err error
	db, err = sql.Open("mysql", dsn)
	if err != nil {
		log.Fatal("Could no parse DB DSN: "+err.Error())
	}
	
	err = db.Ping()
	if err != nil {
		log.Fatal("Unable to connect to DB: "+err.Error())
	}

Error 1130: Host '127.0.0.1' is not allowed to connect to this MySQL server

@clarkk
Copy link
Author

clarkk commented Oct 21, 2023

If I connect with unix socket it seems to work unix(/var/run/mysqld/mysqld.sock)

@go-sql-driver go-sql-driver locked and limited conversation to collaborators Oct 21, 2023
@methane methane converted this issue into discussion #1503 Oct 21, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant