# Learning ruby on Mac - rake create error

**URL:** <https://discuss.rubyonrails.org/t/learning-ruby-on-mac-rake-create-error/45892>\
**Category:** rubyonrails-talk\
**Created:** [September 9, 2009, 12:56am UTC](https://discuss.rubyonrails.org/t/learning-ruby-on-mac-rake-create-error/45892 "2009-09-09T00:56:56Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rick3](https://avatars.discourse-cdn.com/v4/letter/r/ecb155/32.png) [@Rick3](https://discuss.rubyonrails.org/u/Rick3)\
**Post date:** [September 9, 2009, 12:56am UTC](https://discuss.rubyonrails.org/t/learning-ruby-on-mac-rake-create-error/45892/1 "2009-09-09T00:56:56Z")

</div>

rake db:create:all works fine here:

/mystest 741 \> mysql --version mysql Ver 14.14 Distrib 5.1.31, for apple-darwin9.5.0 (powerpc) using readline 5.1 /mystest 742 \> gem list mysql

\*\*\* LOCAL GEMS \*\*\*

mysql (2.8.1) /mystest 743 \> cat config/database.yml # MySQL. Versions 4.1 and 5.0 are recommended.

---

<div class="post-metadata">

**Author:** ![dan11](https://avatars.discourse-cdn.com/v4/letter/d/91b2a8/32.png) [@dan11](https://discuss.rubyonrails.org/u/dan11)\
**Post date:** [November 7, 2009, 11:19pm UTC](https://discuss.rubyonrails.org/t/learning-ruby-on-mac-rake-create-error/45892/2 "2009-11-07T23:19:16Z")

</div>

i was using sqlite for the past few projects and getting things running smoothly enough recently getting macports, git, installing a git module; geokit turns out geokit has more functionality in mysql / postgress then sqlite, namely distancing functions

i create the project as mysql, scaffold a location model then try to run db:create but i fail on rake db:create command

\<code\> Couldn't create database for {"reconnect"=\>false, "encoding"=\>"utf8", "username"=\>"\*\*\*", "adapter"=\>"mysql", "database"=\>"v3\_development\_2", "pool"=\>5, "password"=\>"\*\*\*", "socket"=\>"/tmp/mysql.sock"}, charset: utf8, collation: utf8\_general\_ci (if you set the charset manually, make sure you have a matching collation) \</code\>

\*\*\* used for username and password

i can login to mysql with the username and password s displays current character set latin1 i can change to utf8, run the command and get same error if i restart mysql, it returns to latin1

is character set really the issue? do i need directory user permissions to create the db from rails?

rails 2.3.3 ruby 1.8.7 mysql 5.1.39

\<code\> mysql Ver 14.14 Distrib 5.1.39, for apple-darwin9.5.0 (i386) using readline 5.1

Connection id: 438 SSL: Not in use Current pager: stdout Using outfile: '' Using delimiter: ; Server version: 5.1.39 MySQL Community Server (GPL) Protocol version: 10 Connection: Localhost via UNIX socket Client characterset: latin1 Server characterset: latin1 UNIX socket: /tmp/mysql.sock Uptime: 14 min 32 sec \</code\>

---

<div class="post-metadata">

**Author:** ![dan11](https://avatars.discourse-cdn.com/v4/letter/d/91b2a8/32.png) [@dan11](https://discuss.rubyonrails.org/u/dan11)\
**Post date:** [November 8, 2009, 8:37am UTC](https://discuss.rubyonrails.org/t/learning-ruby-on-mac-rake-create-error/45892/3 "2009-11-08T08:37:23Z")

</div>

so is this mysql default charset as latin1 really a problem?

---

<div class="post-metadata">

**Author:** ![Steve\_Wilhelm](https://avatars.discourse-cdn.com/v4/letter/s/b9bd4f/32.png) [@Steve\_Wilhelm](https://discuss.rubyonrails.org/u/Steve_Wilhelm)\
**Post date:** [November 13, 2009, 6:51pm UTC](https://discuss.rubyonrails.org/t/learning-ruby-on-mac-rake-create-error/45892/4 "2009-11-13T18:51:17Z")

</div>

I am having a similar problem. Did you find a solution?

---

<div class="post-metadata">

**Author:** ![Bryan\_Richard](https://avatars.discourse-cdn.com/v4/letter/b/3ec8ea/32.png) [@Bryan\_Richard](https://discuss.rubyonrails.org/u/Bryan_Richard)\
**Post date:** [November 22, 2009, 3:28pm UTC](https://discuss.rubyonrails.org/t/learning-ruby-on-mac-rake-create-error/45892/5 "2009-11-22T15:28:02Z")

</div>

I had this same issue with an older project but not with a new project, so I copied the newer database.yml file to the older project, renamed the database in the file, and then things worked. My new entry looks like this:

development: &nbsp;&nbsp;adapter: mysql &nbsp;&nbsp;encoding: utf8 &nbsp;&nbsp;reconnect: false &nbsp;&nbsp;database: dev &nbsp;&nbsp;pool: 5 &nbsp;&nbsp;username: strike &nbsp;&nbsp;password: secret

---

<div class="post-metadata">

**Author:** ![dan11](https://avatars.discourse-cdn.com/v4/letter/d/91b2a8/32.png) [@dan11](https://discuss.rubyonrails.org/u/dan11)\
**Post date:** [November 23, 2009, 8:13pm UTC](https://discuss.rubyonrails.org/t/learning-ruby-on-mac-rake-create-error/45892/6 "2009-11-23T20:13:33Z")

</div>

i still have not found a solution to this problem i have reached out to a few sources for help my most detailed list of issues can be found here:

[http://railsforum.com/viewtopic.php?pid=113115](http://railsforum.com/viewtopic.php?pid=113115)

its very frustrating...cannot create a db using mysql on mac

---

<div class="post-metadata">

**Author:** ![fancybeast](https://avatars.discourse-cdn.com/v4/letter/f/d6d6ee/32.png) [@fancybeast](https://discuss.rubyonrails.org/u/fancybeast)\
**Post date:** [December 5, 2009, 12:59am UTC](https://discuss.rubyonrails.org/t/learning-ruby-on-mac-rake-create-error/45892/7 "2009-12-05T00:59:46Z")

</div>

Using a different version of mysql solved this problem for me:

5.1.41 Mac OS X 10.5 (x86\_64) --- doesn't work

5.1.41 Mac OS X 10.5 (x86) -- works

---

<div class="post-metadata">

**Author:** ![Con](https://avatars.discourse-cdn.com/v4/letter/c/9fc29f/32.png) [@Con](https://discuss.rubyonrails.org/u/Con)\
**Post date:** [December 5, 2009, 5:33am UTC](https://discuss.rubyonrails.org/t/learning-ruby-on-mac-rake-create-error/45892/8 "2009-12-05T05:33:12Z")

</div>

> Using a different version of mysql solved this problem for me:
> 
> 5.1.41 Mac OS X 10.5 (x86\_64) — doesn’t work
> 
> 5.1.41 Mac OS X 10.5 (x86) – works
> 
> –

I have successfully installed MySQL 5.1.41 on Snow Leopard using MacPorts 1.8.1 and the file

type is as follows:

/opt/local/bin/mysql5: Mach-O 64-bit executable x86\_64

-Conrad
