Hi, A newbie in the RoR world, I''m already more or less stuck when generating the scaffold for my first tutorial project ... When I try to generate scaffold code for my version of the ''depot'' application from the ''Agile rails ...'' book, I receive the following error: #28000Access denied for user ''bo''@''localhost'' (using password: NO) I''m pretty sure that the MySQL database priviliges are set correctly, and also that my yml file is ok. The entire response that I get; Depot> ruby script/generate scaffold Product Admin exists app/controllers/ exists app/helpers/ create app/views/admin exists test/functional/ dependency model exists app/models/ exists test/unit/ exists test/fixtures/ create app/models/product.rb create test/unit/product_test.rb create test/fixtures/products.yml #28000Access denied for user ''bo''@''localhost'' (using password: NO) My YML file for my development project: development: adapter: mysql database: Depot_development host: localhost username: bo password: I hope very much that someone will have met the same obstacles, having found a solution that I can adapt. Any help very much appreciated, Best regards, Bo -- Posted via http://www.ruby-forum.com/.
On Sun, 2006-01-29 at 00:25 +0100, Bo Vittrup wrote:> Hi, > > A newbie in the RoR world, I''m already more or less stuck when > generating the scaffold for my first tutorial project ... > > When I try to generate scaffold code for my version of the ''depot'' > application from the ''Agile rails ...'' book, I receive the following > error: > > #28000Access denied for user ''bo''@''localhost'' (using password: NO) > > I''m pretty sure that the MySQL database priviliges are set correctly, > and also that my yml file is ok. >---- you might be pretty sure but the response is telling you that it isn''t working... when you can access the mysql server @ localhost as user bo without a password, then rails can do it too. In cli... mysql Depot_development -h localhost -u bo it either connects or errors...in your case, it would error. That is the connection that rails is trying to make from your info...> > development: > adapter: mysql > database: Depot_development > host: localhost > username: bo > password:Things I would look at... Is your database Depot_development or depot_development? Are you connecting via TCP/IP or socket? (your database.yml didn''t specify) Craig
I''m having a similar problem creating the scaffolding for the Depot demo. When I run the generate scaffold script, it seems to stall after it creates products.yml with no error. I am connecting to MySQL as root with no password using socket. Has anybody else run into this? depot> ruby script/generate scaffold Product Admin exists app/controllers/ exists app/helpers/ exists app/views/admin exists test/functional/ dependency model exists app/models/ exists test/unit/ exists test/fixtures/ create app/models/product.rb create test/unit/product_test.rb create test/fixtures/products.yml * After it prints this, it just stalls. No error message is printed, nor does anything happen for 10+ minutes until I hit ctrl-C. When I hit ctrl-C this is what is printed: ^C/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/vendor/mysql.rb:1079:in `read'': Interrupt from /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/vendor/mysql.rb:1079:in `read'' from /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/vendor/mysql.rb:499:in `read'' from /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/vendor/mysql.rb:492:in `command'' from /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/vendor/mysql.rb:339:in `stat'' from /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:147:in `active?'' from /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:103:in `retrieve_connection'' from /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:20:in `connection'' from /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:107:in `retrieve_connection'' ... 20 levels... from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require__'' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require'' from /usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in `require'' from script/generate:3 I am able to connect to MySQL fine as root. depot> mysql depot_development -h localhost -u root Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 70 to server version: 5.0.18-standard Type ''help;'' or ''\h'' for help. Type ''\c'' to clear the buffer. mysql> My .yml file: development: adapter: mysql database: depot_development username: root password: socket: /tmp/mysql.sock -- Posted via http://www.ruby-forum.com/.
Craig White
2006-Jan-29 02:10 UTC
[Rails] Re: Rails scaffolding - cannot get access to MySQL
On Sun, 2006-01-29 at 02:08 +0100, jeff wrote:> I''m having a similar problem creating the scaffolding for the Depot > demo. When I run the generate scaffold script, it seems to stall after > it creates products.yml with no error. I am connecting to MySQL as root > with no password using socket. Has anybody else run into this? > > > depot> ruby script/generate scaffold Product Admin > exists app/controllers/ > exists app/helpers/ > exists app/views/admin > exists test/functional/ > dependency model > exists app/models/ > exists test/unit/ > exists test/fixtures/ > create app/models/product.rb > create test/unit/product_test.rb > create test/fixtures/products.yml > > * After it prints this, it just stalls. No error message is printed, nor > does anything happen for 10+ minutes until I hit ctrl-C. When I hit > ctrl-C this is what is printed: > > > ^C/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/vendor/mysql.rb:1079:in > `read'': Interrupt > from > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/vendor/mysql.rb:1079:in > `read'' > from > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/vendor/mysql.rb:499:in > `read'' > from > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/vendor/mysql.rb:492:in > `command'' > from > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/vendor/mysql.rb:339:in > `stat'' > from > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/mysql_adapter.rb:147:in > `active?'' > from > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:103:in > `retrieve_connection'' > from > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:20:in > `connection'' > from > /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:107:in > `retrieve_connection'' > ... 20 levels... > from > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require__'' > from > /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:18:in `require'' > from > /usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in > `require'' > from script/generate:3 > > > I am able to connect to MySQL fine as root. > > depot> mysql depot_development -h localhost -u root > Reading table information for completion of table and column names > You can turn off this feature to get a quicker startup with -A > > Welcome to the MySQL monitor. Commands end with ; or \g. > Your MySQL connection id is 70 to server version: 5.0.18-standard > > Type ''help;'' or ''\h'' for help. Type ''\c'' to clear the buffer. > > mysql> > > > > My .yml file: > > development: > adapter: mysql > database: depot_development > username: root > password: > socket: /tmp/mysql.sock---- are you sure ^^^^^^^^^^^^^ that this is where your mysql.sock is? ps aux|grep mysql.sock on my Linux systems, the socket is /var/lib/mysql/mysql.sock Craig
Craig White wrote:>> >> development: >> adapter: mysql >> database: depot_development >> username: root >> password: >> socket: /tmp/mysql.sock > ---- > are you sure ^^^^^^^^^^^^^ that this is where your mysql.sock is? > > ps aux|grep mysql.sock > > on my Linux systems, the socket is /var/lib/mysql/mysql.sock > > CraigWell, technically the socket is in /private/tmp/mysql.sock, but there is a link from root to /tmp. So, yes, this is the correct location of mysql.sock. I also tried commenting out the socket connection and using host: localhost port: 3306 instead. Same problem. The script just stalls in the same place as before. -- Posted via http://www.ruby-forum.com/.
Craig White
2006-Jan-29 03:03 UTC
[Rails] Re: Re: Rails scaffolding - cannot get access to MySQL
On Sun, 2006-01-29 at 03:41 +0100, jeff wrote:> Craig White wrote: > > >> > >> development: > >> adapter: mysql > >> database: depot_development > >> username: root > >> password: > >> socket: /tmp/mysql.sock > > ---- > > are you sure ^^^^^^^^^^^^^ that this is where your mysql.sock is? > > > > ps aux|grep mysql.sock > > > > on my Linux systems, the socket is /var/lib/mysql/mysql.sock > > > > Craig > > > Well, technically the socket is in /private/tmp/mysql.sock, but there is > a link from root to /tmp. So, yes, this is the correct location of > mysql.sock. I also tried commenting out the socket connection and using > > host: localhost > port: 3306 > > instead. Same problem. The script just stalls in the same place as > before.---- leave nothing to chance... make sure that after password: there is only a line feed...no spaces/tabs, etc. try changing the socket from /tmp/mysql.sock to /private/tmp/mysql.sock try putting in root''s password if root has a password and finally, try using port 3306 from command line... mysql localhost -P 3306 -u root and see if you connect Craig
jeff
2006-Jan-29 03:50 UTC
[Rails] Re: Re: Re: Rails scaffolding - cannot get access to MySQL
Craig White wrote:> try changing the socket from /tmp/mysql.sock to /private/tmp/mysql.sock > > try putting in root''s password if root has a password > > and finally, try using port 3306 from command line... > > mysql localhost -P 3306 -u root > > and see if you connect > > CraigI connect successfully using mysql depot_development -u root -P 3306 I tried changing the socket to /private/tmp/mysql.sock. Same thing still. It just stalls after depot> ruby script/generate scaffold Product Admin exists app/controllers/ exists app/helpers/ exists app/views/admin exists test/functional/ dependency model exists app/models/ exists test/unit/ exists test/fixtures/ create app/models/product.rb create test/unit/product_test.rb create test/fixtures/products.yml I guess I forgot to mention, I''m running on Mac OS x 10.4.4 with MySQL 5.0.18. Still stumped, Jeff -- Posted via http://www.ruby-forum.com/.
Craig White
2006-Jan-29 06:28 UTC
[Rails] Re: Re: Re: Rails scaffolding - cannot get access to MySQL
On Sun, 2006-01-29 at 04:50 +0100, jeff wrote:> Craig White wrote: > > > try changing the socket from /tmp/mysql.sock to /private/tmp/mysql.sock > > > > try putting in root''s password if root has a password > > > > and finally, try using port 3306 from command line... > > > > mysql localhost -P 3306 -u root > > > > and see if you connect > > > > Craig > > I connect successfully using mysql depot_development -u root -P 3306 > I tried changing the socket to /private/tmp/mysql.sock. > > Same thing still. It just stalls after > > depot> ruby script/generate scaffold Product Admin > exists app/controllers/ > exists app/helpers/ > exists app/views/admin > exists test/functional/ > dependency model > exists app/models/ > exists test/unit/ > exists test/fixtures/ > create app/models/product.rb > create test/unit/product_test.rb > create test/fixtures/products.yml > > I guess I forgot to mention, I''m running on Mac OS x 10.4.4 with MySQL > 5.0.18. > > > Still stumped,---- sorry - I''m out of ideas... Craig
softwareengineer 99
2006-Jan-29 07:36 UTC
[Rails] Re: Re: Re: Rails scaffolding - cannot get access to MySQL
When I had a similar issue, I was able to resolve it by changing host to 127.0.0.1 instead of localhost. Have you tried chaning your host name? Also pay attention to the MySQL permissions table. Hope it helps. Frank Craig White <craigwhite@azapple.com> wrote: On Sun, 2006-01-29 at 04:50 +0100, jeff wrote:> Craig White wrote: > > > try changing the socket from /tmp/mysql.sock to /private/tmp/mysql.sock > > > > try putting in root''s password if root has a password > > > > and finally, try using port 3306 from command line... > > > > mysql localhost -P 3306 -u root > > > > and see if you connect > > > > Craig > > I connect successfully using mysql depot_development -u root -P 3306 > I tried changing the socket to /private/tmp/mysql.sock. > > Same thing still. It just stalls after > > depot> ruby script/generate scaffold Product Admin > exists app/controllers/ > exists app/helpers/ > exists app/views/admin > exists test/functional/ > dependency model > exists app/models/ > exists test/unit/ > exists test/fixtures/ > create app/models/product.rb > create test/unit/product_test.rb > create test/fixtures/products.yml > > I guess I forgot to mention, I''m running on Mac OS x 10.4.4 with MySQL > 5.0.18. > > > Still stumped,---- sorry - I''m out of ideas... Craig _______________________________________________ Rails mailing list Rails@lists.rubyonrails.org http://lists.rubyonrails.org/mailman/listinfo/rails --------------------------------- What are the most popular cars? Find out at Yahoo! Autos -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060129/aa81c64f/attachment.html
softwareengineer 99 wrote:> When I had a similar issue, I was able to resolve it by changing host > to 127.0.0.1 instead of localhost. Have you tried chaning your host > name? Also pay attention to the MySQL permissions table. > > Hope it helps. > Frank >Nope, no luck. Thanks for the suggestions. I guess I''ll keep trying... Jeff -- Posted via http://www.ruby-forum.com/.