go-sql-driver and MySQL 8
I should know better than to use a
latest tag in a Docker image. I’d never do this at work, so why did I do it in my hobby project? I blame Go’s nature of dealing with package versioning (that is, the lack thereof) for putting me in the “let’s use latest!” mindset (and yes I know they’re working on it). Anyway, I should know better, but here we are, writing this post. It’s going to be a short one.
A couple of weeks ago I started seeing
this authentication plugin is not supported errors in my tests on the CI. I couldn’t repro this locally and after some head scratching I noticed the MySQL version has been updated on Dockerhub from
8.0. I only use Docker on the CI, not locally, and locally my MySQL version hadn’t changed, which would explain the inability to reproduce the problem. After a bit more digging I came across this issue reported for
go-sql-driver: Unable to connect to MySQL 8.
Anyway, for now I’m just specifying the
5.7 MySQL image to work around this issue.