go-rest-api
go-rest-api copied to clipboard
Cannot user MySQL
Describe the bug
I'd like to use my local mysql instead of Docker postgresql, so I used this in local.yml:
dsn: "mysql://127.0.0.1:3306/mydb?sslmode=disable&user=myuser&password=mypassword"
To Reproduce
Steps to reproduce the behavior:
- At
make runI get this error:
make run
go run -ldflags "-X main.Version=v1.0.1-5-gc310133-dirty" cmd/server/main.go
{"level":"error","ts":1636005794.9442818,"caller":"server/main.go:47","msg":"sql: unknown driver \"mysql\" (forgotten import?)","version":"v1.0.1-5-gc310133-dirty","stacktrace":"main.main\n\t/home/pc/go/src/go-rest-api/cmd/server/main.go:47\nruntime.main\n\t/usr/local/go/src/runtime/proc.go:203"}
exit status 255
Makefile:34: recipe for target 'run' failed
make: *** [run] Error 1
Expected behavior Expect a clear documenation or hint on how to switch DB
Environment (please complete the following information):
- OS: Ubuntu Linux