mysql rake functions failing

View: New views
5 Messages — Rating Filter:   Alert me  

mysql rake functions failing

by dan-339 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


im new to mac and ruby but have been through some tutorials using
sqlite
ive downloaded a plugin for geolocation and it needs mysql for
advanced functionality
however whenever i try to run the rake commads with mysql adapter, i
get errors

i created the ruby app using the -d mysql command
my database.yml looks as follows

development:
  adapter: mysql
  encoding: utf8
  reconnect: false
  database: geokit_v1
  pool: 5
  username: root
  password: **** # hiddne root password
  socket: /tmp/mysql.sock

rake db:create yields

Couldn't create database for {"reconnect"=>false, "encoding"=>"utf8",
"username"=>"root", "adapter"=>"mysql", "database"=>"geokit_v1",
"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)

some posts about this topic say the charset may be misleading
yet in mysql if i see this
<code>
mysql> show variables like 'char%';
+--------------------------
+--------------------------------------------------------+
| Variable_name            |
Value                                                  |
+--------------------------
+--------------------------------------------------------+
| character_set_client     |
latin1                                                 |
| character_set_connection |
latin1                                                 |
| character_set_database   |
latin1                                                 |
| character_set_filesystem |
binary                                                 |
| character_set_results    |
latin1                                                 |
| character_set_server     |
latin1                                                 |
| character_set_system     |
utf8                                                   |
| character_sets_dir       | /usr/local/mysql-5.1.40-osx10.5-x86_64/
share/charsets/ |
+--------------------------
+--------------------------------------------------------+
8 rows in set (0.00 sec)
</code>

rails 2.3.3
ruby 1.8.7
Server version: 5.1.40 MySQL Community Server (GPL)

this is super annoying
it has been for the whole weekend

please help


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: mysql rake functions failing

by Adam Akhtar-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


dan wrote:

>
> Couldn't create database for {"reconnect"=>false, "encoding"=>"utf8",
> "username"=>"root", "adapter"=>"mysql", "database"=>"geokit_v1",
> "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)
>

When you installed MySQL, you were presented with a screen asking your
for character set information.  Do you remember what you chose?  I never
specify my charset within the config file (I am not sure if this is
correct or not)

You can change the default char set through the MySQLAdmin tool and need
not worry when connecting with AR.

hth

ilan
--
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: mysql rake functions failing

by dan-339 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


i did not get a screen asking for default character set
the instructions ive found to chang it (my.cnf , \C) do not seem to
take
using the \C command while logged into mysql seem to change some of
the character sets
but if i \q then restart my mysl -u root connection, when i run show
variables like 'char%';  theyre all back to latin1

show how do i change it to utf8 for good?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: mysql rake functions failing

by Rick-13 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I use the MySQL Administrator gui, Options -> Advanced.

http://dev.mysql.com/downloads/gui-tools/5.0.html


On Nov 9, 2:46 pm, dan <mr.dan.ma...@...> wrote:
> i did not get a screen asking for default character set
> the instructions ive found to chang it (my.cnf , \C) do not seem to
> take
> using the \C command while logged into mysql seem to change some of
> the character sets
> but if i \q then restart my mysl -u root connection, when i run show
> variables like 'char%';  theyre all back to latin1
>
> show how do i change it to utf8 for good?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@...
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: mysql rake functions failing

by dan-339 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

i was able to set default charset to utf8...still getting error
running rake db:create

please see full detail of issues here:

http://railsforum.com/viewtopic.php?pid=113115

thanks



On Nov 10, 4:23 am, Rick <richard.t.ll...@...> wrote:

> I use the MySQL Administrator gui, Options -> Advanced.
>
> http://dev.mysql.com/downloads/gui-tools/5.0.html
>
> On Nov 9, 2:46 pm, dan <mr.dan.ma...@...> wrote:
>
>
>
> > i did not get a screen asking for default character set
> > the instructions ive found to chang it (my.cnf , \C) do not seem to
> > take
> > using the \C command while logged into mysql seem to change some of
> > the character sets
> > but if i \q then restart my mysl -u root connection, when i run show
> > variables like 'char%';  theyre all back to latin1
>
> > show how do i change it to utf8 for good?

--

You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@....
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@....
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=.