hi! i created a db with one table "users" with one record, then run ruby script/console>>User.find(:first)returns : "access denied for root@localhost" why is that? i created the table and record inside mysql through the same user and password in database.yml. joey -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Wed, 2008-07-30 at 04:57 +0200, Joey Boy wrote:> hi! > > i created a db with one table "users" with one record, then run ruby > script/console > > >>User.find(:first) > > returns : "access denied for root@localhost" > > why is that? i created the table and record inside mysql through the > same user and password in database.yml.---- sounds like when you connected to mysql from command line, it used sockets but your setup in database.yml is using port 3306 which actually is different. You probably want to figure out where the socket is, enter that in database.yml and comment out the port... stuff removed for clarity... # ps aux|grep mysql.sock root 8017 0.0 0.0 4524 224 pts/1 S Jul27 0:00 /bin/sh /usr/bin/mysqld_safe --socket=/var/lib/mysql/mysql.sock thus I would want to add to database.yml... socket: /var/lib/mysql/mysql.sock Craig --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Check you password in database.yml. Also, make sure you actually have a root user in mysql. On Tue, Jul 29, 2008 at 11:57 PM, Joey Boy <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > hi! > > i created a db with one table "users" with one record, then run ruby > script/console > > >>User.find(:first) > > returns : "access denied for root@localhost" > > why is that? i created the table and record inside mysql through the > same user and password in database.yml. > > > joey > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Craig White wrote:> On Wed, 2008-07-30 at 04:57 +0200, Joey Boy wrote: >> same user and password in database.yml. > ---- > sounds like when you connected to mysql from command line, it used > sockets but your setup in database.yml is using port 3306 which actually > is different. > > You probably want to figure out where the socket is, enter that in > database.yml and comment out the port... > > stuff removed for clarity... > # ps aux|grep mysql.sock > root 8017 0.0 0.0 4524 224 pts/1 S Jul27 > 0:00 /bin/sh /usr/bin/mysqld_safe --socket=/var/lib/mysql/mysql.sock > > thus I would want to add to database.yml... > socket: /var/lib/mysql/mysql.sock > > Craighi! how do you do the same with windows? -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Marcelo de Moraes Serpa wrote:> Check you password in database.yml. Also, make sure you actually have a > root > user in mysql. > > On Tue, Jul 29, 2008 at 11:57 PM, Joey Boy > <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.orghello! thank you. i''m 101% about the password, and i do have root account in mysql. i actually created another account with same user as the db. hoping rails was expecting that. but..apparently..i''m wrong.. :-( -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
2008/7/30, Joey Boy <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>:> > > Marcelo de Moraes Serpa wrote: > > Check you password in database.yml. Also, make sure you actually have a > > root > > user in mysql. > > > > On Tue, Jul 29, 2008 at 11:57 PM, Joey Boy > > <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org > > hello! > > thank you. i''m 101% about the password, and i do have root account in > mysql. i actually created another account with same user as the db. > hoping rails was expecting that. but..apparently..i''m wrong.. :-( > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Wed, 2008-07-30 at 05:30 +0200, Joey Boy wrote:> Craig White wrote: > > On Wed, 2008-07-30 at 04:57 +0200, Joey Boy wrote: > >> same user and password in database.yml. > > ---- > > sounds like when you connected to mysql from command line, it used > > sockets but your setup in database.yml is using port 3306 which actually > > is different. > > > > You probably want to figure out where the socket is, enter that in > > database.yml and comment out the port... > > > > stuff removed for clarity... > > # ps aux|grep mysql.sock > > root 8017 0.0 0.0 4524 224 pts/1 S Jul27 > > 0:00 /bin/sh /usr/bin/mysqld_safe --socket=/var/lib/mysql/mysql.sock > > > > thus I would want to add to database.yml... > > socket: /var/lib/mysql/mysql.sock > > > > Craig > > hi! > > how do you do the same with windows?---- Oh - Windows...don''t use sockets Can you connect from command line like... mysql YOUR_DATA_BASE -Uroot -p ? Craig --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Craig White wrote:> On Wed, 2008-07-30 at 05:30 +0200, Joey Boy wrote: >> > >> hi! >> >> how do you do the same with windows? > ---- > Oh - Windows...don''t use sockets > > Can you connect from command line like... > > mysql YOUR_DATA_BASE -Uroot -p > > ? > > Craigyes. i can connect. ty! -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
votcka .
2008-Jul-30 04:13 UTC
Re: ****[Rails] Re: ****[Rails] No db connection in console
2008/7/30, Craig White <craigwhite-BQ75lA0ptkhBDgjK7y7TUQ@public.gmane.org>:> > > On Wed, 2008-07-30 at 05:45 +0200, Joey Boy wrote: > > Craig White wrote: > > > On Wed, 2008-07-30 at 05:30 +0200, Joey Boy wrote: > > >> > > > >> hi! > > >> > > >> how do you do the same with windows? > > > ---- > > > Oh - Windows...don''t use sockets > > > > > > Can you connect from command line like... > > > > > > mysql YOUR_DATA_BASE -Uroot -p > > > > > > ? > > > > > > Craig > > > > yes. i can connect. > ----- > then make sure you database.yml does not have any tabs for whitespace > and that none of the entries have any spaces after them. > > Craig > > > > >--~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Joey Boy
2008-Jul-30 04:25 UTC
Re: ****[Rails] Re: ****[Rails] No db connection in console
Craig White wrote:> On Wed, 2008-07-30 at 05:45 +0200, Joey Boy wrote: >> > >> > mysql YOUR_DATA_BASE -Uroot -p >> > >> > ? >> > >> > Craig >> >> yes. i can connect. > ----- > then make sure you database.yml does not have any tabs for whitespace > and that none of the entries have any spaces after them. > > Craigthank you craig. indeed there are whitespaces on the database.yml file. i trusted the database.yml file that come from open source rails-based app. good day! -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi joey The problem is its not getting mysql path with that use name & password..Do onething while creating project use following instruction rails project_name -d mysql It will create database.yml file with mysql path... -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
babu nair wrote:> Hi joey > > The problem is its not getting mysql path with that use name & > password..Do onething while creating project use following instruction > rails project_name -d mysql > It will create database.yml file with mysql path...hi! that''s what i did. i generate a new app and copied the database.yml file over the problematic one. that fixed it. thank you so much guys! -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---