I''m getting ''Access denied for user ... Using password:YES ... Mysql::Error'' message. The OS is Solaris 5.9, Ruby is 1.8.6 and Rails is 1.2.3. AFAIK these are all fairly new adn shouldn''t suffer from the ''old password'' effect - even so , I have forced the password to be ''old style'' to be on the safe side. The database.yml looks OK to me development: adapter: mysql database: mydatabase1_development username: tobyr password: mypassword #socket: /tmp/mysql.sock host: localhost port: 3406 (I''ve tried with ''socket'' instead of port, with the same result) I know the username and password are right because I can use them to get into mysql from the CLI. Any ideas? thanks! -- 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 -~----------~----~----~----~------~----~------~--~---
johnmcauley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Nov-09 12:34 UTC
Re: Access Denied for user
Is this because of the permission set up on the mysql? i.e. certain users or groups have certain permissions from certain machines, ip-addresses. On Nov 9, 8:52 am, Toby Rodwell <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I''m getting ''Access denied for user ... Using password:YES ... > Mysql::Error'' message. The OS is Solaris 5.9, Ruby is 1.8.6 and Rails > is 1.2.3. AFAIK these are all fairly new adn shouldn''t suffer from the > ''old password'' effect - even so , I have forced the password to be ''old > style'' to be on the safe side. The database.yml looks OK to me > > development: > adapter: mysql > database: mydatabase1_development > username: tobyr > password: mypassword > #socket: /tmp/mysql.sock > host: localhost > port: 3406 > > (I''ve tried with ''socket'' instead of port, with the same result) > > I know the username and password are right because I can use them to get > into mysql from the CLI. > > Any ideas? > > thanks! > -- > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---
Thanks for the reply - What identify does Ruby use when accessing mysql? For example, from the command line I can run ~toby/rails/mydatabase#mysql -u tobyr -p Password: <Success> but if I run (from the same command line prompt) ~toby/rails/mydatabase#ruby my-test-script.sh <access denied> johnmcauley-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> Is this because of the permission set up on the mysql? > i.e. certain users or groups have certain permissions from certain > machines, ip-addresses. > > On Nov 9, 8:52 am, Toby Rodwell <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>-- 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 -~----------~----~----~----~------~----~------~--~---
The standard mysql port is 3306, not 3406. Do you have mysql running on a different port? If not, change database.yml to development: adapter: mysql database: mydatabase1_development username: tobyr password: mypassword #socket: /tmp/mysql.sock host: localhost port: 3306 # <- port 3306 -Bill Toby Rodwell wrote:> I''m getting ''Access denied for user ... Using password:YES ... > Mysql::Error'' message. The OS is Solaris 5.9, Ruby is 1.8.6 and Rails > is 1.2.3. AFAIK these are all fairly new adn shouldn''t suffer from the > ''old password'' effect - even so , I have forced the password to be ''old > style'' to be on the safe side. The database.yml looks OK to me > > development: > adapter: mysql > database: mydatabase1_development > username: tobyr > password: mypassword > #socket: /tmp/mysql.sock > host: localhost > port: 3406 > > (I''ve tried with ''socket'' instead of port, with the same result) > > I know the username and password are right because I can use them to get > into mysql from the CLI. > > Any ideas? > > thanks! >-- Sincerely, William Pratt --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Sorry, I should have made that clearer - there are two instances of mysql running and the one I want is on 3406. In fact, is there any possibility this line is being ignored and port 3306 *is* being used, because if I change ''port'' to some random number (1234) I get the *same* error message (''Access denied'')? I''m confident I''m editing the right section of datanbase.yml because if I change, say, the username then I see the new username reflected in the error message I get. William Pratt wrote:> The standard mysql port is 3306, not 3406. Do you have mysql running on > a different port? If not, change database.yml to > > development: > adapter: mysql > database: mydatabase1_development > username: tobyr > password: mypassword > #socket: /tmp/mysql.sock > host: localhost > port: 3306 # <- port 3306 > > > -Bill > > Toby Rodwell wrote: >> password: mypassword >> >> thanks! >> > > -- > Sincerely, > > William Pratt-- 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 -~----------~----~----~----~------~----~------~--~---
Fixed it! The problem was related to the two instances of Mysql. I wanted to connect to the instance on the non-standard port (3406). I correctly added the ''port: 3406'' line to database.yml, but I left ''host: localhost''. However, as implied at http://www.kitebird.com/articles/ruby-mysql.html#TOC_12 ''localhost'' is relevant to the Unix socket, not a TCP/IP connection. So, strange as it may seem, replacing ''localhost'' with the Fully Qualified Domain Name fixed the problem. -- 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 -~----------~----~----~----~------~----~------~--~---