Skip to content
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

Create database not suported? #16

Open
ThomasAlxDmy opened this issue Jan 22, 2016 · 1 comment
Open

Create database not suported? #16

ThomasAlxDmy opened this issue Jan 22, 2016 · 1 comment

Comments

@ThomasAlxDmy
Copy link

Hi there,

I'm trying this package for the first time and I can't make it work.

2016/01/21 18:38:15 Migrations table not found
2016/01/21 18:38:15 Error creating migrations table: Error 1046: No database selected
if db, err := sql.Open("mysql", *mysqlUser+":"+*mysqlPassword+"@tcp("+*mysqlIp+":"+*mysqlPort+")/")
err != nil {
        log.Fatal(err)
    }

migrator, err := gomigrate.NewMigrator(db, gomigrate.Mysql{}, "./migrations")
migrator.CreateMigrationsTable()

Am I doing something wrong or creating a database is not supported?

@mikeatlas
Copy link

You probably can pass the database name as part of the sql.Open string after the / symbol.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants