hi all, the graphing tool someone published (can''t find who, but I have the code) which seems really cool won''t connect to mysql properly, even though my rails install will. it adds the hostname to my username for the mysql connect, so I''m denied because it''s the wrong user: i.e. example_user in my database.yaml is: example_user-NUfqCKFlCCs+6oi84+IkFQ@public.gmane.org in the error: /usr/lib/ruby/gems/1.8/gems/activerecord-1.10.1/lib/active_record/ vendor/mysql.rb:452:in `read'': Access denied for user: ''example_user-NUfqCKFlCCs+6oi84+IkFQ@public.gmane.org'' (Using password: YES) (Mysql::Error) note that the database is on localhost, I have host in database.yaml specified to the loopback addy: 127.0.0.1 I had a cursory glance at mysql.rb, but couldn''t find anything it was doing wrong. tia, _alex -- alex black, founder the turing studio, inc. 510.666.0074 root-16h2cdTTKgpzNNFeSAH1EA@public.gmane.org http://www.turingstudio.com 2600 10th street, suite 635 berkeley, ca 94710
alex black wrote:> the graphing tool someone published (can''t find who, but I have the > code) which seems really cool won''t connect to mysql properly, even > though my rails install will.It just uses config/environment.rb like all the other tools in /script. If it can''t connect there''s likely something wrong in there.
> It just uses config/environment.rb like all the other tools in > /script. If it can''t connect there''s likely something wrong in there.Nope - the rails app that uses environment.rb can connect perfectly well, as I said. Any other ideas? _alex -- alex black, founder the turing studio, inc. 510.666.0074 root-16h2cdTTKgpzNNFeSAH1EA@public.gmane.org http://www.turingstudio.com 2600 10th street, suite 635 berkeley, ca 94710
alex black wrote:>> It just uses config/environment.rb like all the other tools in >> /script. If it can''t connect there''s likely something wrong in there. > > Nope - the rails app that uses environment.rb can connect perfectly > well, as I said. > > Any other ideas?Perhaps your application is using another environment than the script. You can change the script used in the script via ENV["RAILS_ENV"]. Did you specify the same database information for all environments in your database.yaml? I guess you could also check whether script/console works.
hi florian, this has no effect. I looked at your code, and I''m certain the includes are correct. the script is in graph_db under the rails base path (graph db is parallel to script) so it''s including the environment because it has the first part of the right username. but _something_ is choosing to append the hostname only when your script is run, and I can''t find it. I''d like to package this up so it works in development with a single command and is distributed as a tarball :) _a On May 17, 2005, at 1:33 PM, Florian Groß wrote:> ENV["RAILS_ENV"]-- alex black, founder the turing studio, inc. 510.666.0074 root-16h2cdTTKgpzNNFeSAH1EA@public.gmane.org http://www.turingstudio.com 2600 10th street, suite 635 berkeley, ca 94710