[ACCEPTED]-Rails / MySQL2: Error - Unknown database-macos

Accepted answer
Score: 60

Have you created the database in MySQL? You 2 should be able to run rake db:create and have Rails create 1 it for you.

Score: 16

I had the same error, please run the following 2 command on the Command Prompt:

rake db:create 

to solve the 1 problem.

Score: 5

Look for the answers of these questions:

  1. Have you installed the mysql2 gem?
  2. Is it mentioned in your Gemfile?
  3. Did you run the command rake db:create ?


Score: 0

Sometimes creating database with rake causes 9 issues.

You can also create the database 8 inside mysql

Make sure mysql is in the root 7 %PATH% in command prompt type echo %PATH% to 6 check.

If it isn't in your PATH. Then do 5 a quick google search on windows PATH to 4 get instructions

Open command prompt

type 3 mysql -u root -p

type your password that 2 you created for your root

To create database 1

create database simple_cms_development


Score: 0

was getting the same error but caused was 5 different

Mysql2::Error: Unknown database 'rdddd_development'

/Users/.rvm/gems/ruby-2.6.3/gems/mysql2-0.5.2/lib/mysql2/client.rb:90:in 4 connect' /Users/commeasure/.rvm/gems/ruby-2.6.3/gems/mysql2-0.5.2/lib/mysql2/client.rb:90:ininitialize

faced this error due to the created 3 method dynamically, code is here

Role.all.map(&:name).map(&:parameterize).map(&:underscore).each do |name|
    define_method("#{name.to_sym}?") do
     role.name == name.upcase

How do 2 I fix this for the temporary purpose just 1 comment it out

More Related questions