1

I have a problem running RoR project. I am getting this error while running it "Mysql2::Error Unknown database 'simple_cms_development'" I have no idea what to do with this issue and how to resolve it. Anyone who can helo me. Thanks in advance

Here is bt database.yml file

# MySQL.  Versions 4.1 and 5.0 are recommended.
# 
# Install the MYSQL driver
#   gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
#   gem 'mysql2'
#
# And be sure to use new-style password hashing:
#   http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
  adapter: mysql2
  encoding: utf8
  reconnect: false
  database: simple_cms_development
  pool: 5
  username: root
  password: "123456"
  host: localhost

# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
  adapter: mysql2
  encoding: utf8
  reconnect: false
  database: simple_cms_test
  pool: 5
  username: root
  password:
  host: localhost

production:
  adapter: mysql2
  encoding: utf8
  reconnect: false
  database: simple_cms_production
  pool: 5
  username: root
  password:
  host: localhost

How can I solve this problem?

2 Answers 2

4

Unkown database means the database simple_cms_development doesn't exist yet. If the user root already exists with the password 123456 you can just run rake db:create and then rake db:migrate.

These are commands run from the commandline inside the directory of your rails project

Sign up to request clarification or add additional context in comments.

Comments

3

Is the database created in MySQL? If it's not, you can try running rake db:create to try and have rails create it for you.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.