rake db:create:all Couldn't create database

350 views
Skip to first unread message

Zia

unread,
Dec 16, 2010, 11:19:02 PM12/16/10
to EngineY
Hi,

I'm having trouble connecting with mysql. I tried solutions from
different posts/blogs but so far not able to resolve this. I can
connect to mysql and create db fine, but rake task fails. What am I
doing wrong here?

Please advice.
Thanks,

Zia

rake db:create:all --trace
(in /Users/zs/work/EngineY)
** Invoke db:create:all (first_time)
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:create:all
Couldn't create database for {"username"=>"root", "adapter"=>"mysql",
"database"=>"enginey_development", "host"=>"localhost",
"password"=>nil}, charset: utf8, collation: utf8_unicode_ci (if you
set the charset manually, make sure you have a matching collation)
Couldn't create database for {"username"=>"root", "adapter"=>"mysql",
"database"=>"enginey_test", "host"=>"localhost", "password"=>nil},
charset: utf8, collation: utf8_unicode_ci (if you set the charset
manually, make sure you have a matching collation)


sudo bin/mysqld_safe --skip-grant-tables
101216 19:55:48 mysqld_safe Logging to '/usr/local/mysql-5.5.8-osx10.6-
x86/data/Zia-Syeds-MacBook-Pro.local.err'.
101216 19:55:48 mysqld_safe Starting mysqld daemon with databases
from /usr/local/mysql-5.5.8-osx10.6-x86/data

ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0

rails -v
Rails 2.3.5

uname -a
Darwin Zia-Syeds-MacBook-Pro.local 10.5.0 Darwin Kernel Version
10.5.0: Fri Nov 5 23:20:39 PDT 2010; root:xnu-1504.9.17~1/
RELEASE_I386 i386

ncho

unread,
Dec 17, 2010, 7:32:47 PM12/17/10
to EngineY
You may want to try "gem install ruby-mysql" and then run your rake.

-g-

Cican Rizal

unread,
Dec 20, 2010, 4:57:37 AM12/20/10
to eng...@googlegroups.com
run this command

gem install mysql

 or
change config/database.yml

development:
  adapter: mysql
  database: enginey_development
  username: root
  password: 123456
  host: localhost

test:
  adapter: mysql
  database: enginey_test
  username: root
  password: 123456
  host: localhost

or

put libmySQL.dll to system32 and ruby187/bin


From: ncho <nch...@gmail.com>
To: EngineY <eng...@googlegroups.com>
Sent: Sat, December 18, 2010 7:32:47 AM
Subject: Re: rake db:create:all Couldn't create database
--
You received this message because you are subscribed to the Google Groups "EngineY" group.
To post to this group, send email to eng...@googlegroups.com.
To unsubscribe from this group, send email to enginey+unsub...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/enginey?hl=en.


Zia

unread,
Dec 20, 2010, 11:57:25 PM12/20/10
to EngineY
Thanks for the replies. I actually had to install mysql server from
the Macports and that fixed the problem for me.
> enginey+u...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages