Problem:
- MySQL version 8+
- github.com/go-sql-driver/mysql
- db, err = sql.Open("mysql", "username:password@/database")
(no error) - query, err := db.Query("SELECT * FROM TABLE")
this authentication plugin is not supported
Solution:
mysql> alter user 'username'@'localhost' identified with mysql_native_password by 'password';
See also: https://github.com/go-sql-driver/mysql/issues/785
No comments:
Post a Comment