简体   繁体   中英

Mysql2::Error: Table .schema_migrations' doesn't exist

I just started mining. while i'm trying to setup (and follow the instructions to do that, command - rake db:migration) following error occurred. The article i followed http://angular-rails.com/bootstrap.html

"Mysql2::Error: Table 'amweb_development.schema_migrations' doesn't exist: SELECT schema_migrations .* FROM schema_migrations "

Can i re-configure mysql2 ? will that solve my problem? or is there any other way, i don't have any data in my database, so i can recreate everything.

Please advice. Thanks in advance.

How is your database.yml file setup? I had this same problem and it was due to using a database other than the standard production, test, and development. You can create the schema_migrations table yourself, or you can do it with a rake task. The key if you are using rake is to specify the environment (essentially the name of your database).

if your database.yml file has an entry like such:

amweb_development:
  adapter: mysql2
  host: localhost
  database: amweb_development

then the rake task to setup the database (including the schema migrations table) would be:

rake db:setup RAILS_ENV=amweb_development

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM