rubenv / sql-migrate

SQL schema migration tool for Go.
MIT License
3.23k stars 280 forks source link

Error 1046: No database selected #116

Open muchuang1024 opened 6 years ago

muchuang1024 commented 6 years ago
development:
    dialect: mysql
    datasource: root@/test?parseTime=true
    dir: migrations/mysql
    table: migrations

this is my dbconfig.yml, but it show 'No database selected' when I run command 'sql-migrate status

muchuang1024 commented 6 years ago

@rubenv can you see it ? my mysql password is empty

rubenv commented 6 years ago

I'm sorry, but I don't use MySQL. We have integration tests for MySQL so all I can say is that it should work.

Perhaps there's something wrong with your database? Can't really help out here.

muchuang1024 commented 6 years ago
  1. the datasource must declare dbname? It can't support "one sql for db1, another sql for db2"
  2. when sql declare "use db1", but datasource declare 'db2',It will become conflict