Skip to content

mysql up show database driver: unknown driver mysql (forgotten import?) #1203

Open
@bramble555

Description

Describe the Bug

  1. I ran migrate with the following options 'migrate -path migration -database "mysql://root:123456@tcp(127.0.0.1:3306)/t?t?multiStatements=true" up'
  2. See error: "database driver: unknown driver mysql (forgotten import?)"

Migrate Version
v4.18.1

Go Version
go1.23.3 windows/amd64

supplement
1 month ago, I can run it successfully. But now, it show error.

import (
	"database/sql"
	"fmt"
	"log"

	_ "github.com/go-sql-driver/mysql"
	"github.com/golang-migrate/migrate/v4"
	"github.com/golang-migrate/migrate/v4/database/mysql"
	_ "github.com/golang-migrate/migrate/v4/source/file"
	_ "github.com/mattes/migrate/source/file"
)

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions