2

I'm trying run a rake db:create and it says that the database already exists (I never created this database before, this a new project). When I run rake db:migrate it says "Unknown database". I checked the mysql database (show databases;) and that database really does not exist.

Anyone knows what is that? I searched for solutions but without success.

When I run rake db:create

rake db:create
Celluloid 0.17.3 is running in BACKPORTED mode. [ http://git.io/vJf3J ]
adimax_development already exists
adimax_test already exists

When I run rake db:migrate

rake db:migrate
Celluloid 0.17.3 is running in BACKPORTED mode. [ http://git.io/vJf3J ]
rake aborted!
Mysql2::Error: Unknown database 'adimax_development'

database.yml

development:
 adapter: mysql2
 encoding: utf8
 database: adimax_development
 pool: 5
 username: root
 password:

Error: Error image:

Felipe Marcon
  • 239
  • 2
  • 17

2 Answers2

5

Try executing this command:

rake db:drop db:create db:migrate

Reference: https://stackoverflow.com/a/4116124/9336629

Pang
  • 9,564
  • 146
  • 81
  • 122
Prashant Patel
  • 179
  • 1
  • 2
  • 13
-2

I got solve this creating the database directly in mysql.

I entered in mysql with mysql -u root and than I run "CREATE DATABASE adimax_development;". After this I comeback to my application and run rake db:migrate and that worked.

Thanks to all those who have been willing to help.

Felipe Marcon
  • 239
  • 2
  • 17