I am newbie, and setup RoR 3.1 on Ubuntu 11.04. I followed everything on this blog, and the initial site came up fine on sqlite3: http://excid3.com/blog/ruby-on-rails-3-and-mysql-on-ubuntu-10-10/ Switching to mysql and running the rails server (rails s) displays this issue: ActiveRecord::ConnectionNotEstablished (ActiveRecord::ConnectionNotEstablished): I am pretty sure the database.yml is correct (shown later), that the database exists, and the user nara (myself) can access the database using the mysql client. I have tried rebooting my machine, but that does not help. Any ideas? Nara development: adapter: mysql2 encoding: utf8 reconnect: false database: mblogdev pool: 5 username: nara password: <right-password> socket: /var/run/mysqld/mysqld.sock # Warning: The database defined as "test" will be erased and # re-generated from your development database when you run "rake". # Do not set this db to the same as development or production. test: adapter: mysql2 encoding: utf8 reconnect: false database: mblogtest pool: 5 username: nara password: <right-password> socket: /var/run/mysqld/mysqld.sock production: adapter: mysql2 encoding: utf8 reconnect: false database: mblogprod pool: 5 username: root password: socket: /var/run/mysqld/mysqld.sock -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I also gem installed mysql, and changed everything in database.yml to mysql. Still the same issue with ActiveRecord failing to connect. I will go back to using mysql2, and hopefully, get some help on this group. I will also try the mysql blog author at excid3.com. If I can somehow get mysql2 to work, I will post here. At this rate, it looks like I may have to try postgres instead. Thanks Nara On Sep 10, 3:16 pm, Nara <nar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I am newbie, and setup RoR 3.1 on Ubuntu 11.04. > I followed everything on this blog, and the initial site came up fine > on sqlite3:http://excid3.com/blog/ruby-on-rails-3-and-mysql-on-ubuntu-10-10/ > > Switching to mysql and running the rails server (rails s) displays > this issue: > ActiveRecord::ConnectionNotEstablished > (ActiveRecord::ConnectionNotEstablished): > > I am pretty sure the database.yml is correct (shown later), that the > database exists, and > the user nara (myself) can access the database using the mysql client. > I have tried rebooting my machine, but that does not help. > > Any ideas? > Nara > > development: > adapter: mysql2 > encoding: utf8 > reconnect: false > database: mblogdev > pool: 5 > username: nara > password: <right-password> > socket: /var/run/mysqld/mysqld.sock > > # Warning: The database defined as "test" will be erased and > # re-generated from your development database when you run "rake". > # Do not set this db to the same as development or production. > test: > adapter: mysql2 > encoding: utf8 > reconnect: false > database: mblogtest > pool: 5 > username: nara > password: <right-password> > socket: /var/run/mysqld/mysqld.sock > > production: > adapter: mysql2 > encoding: utf8 > reconnect: false > database: mblogprod > pool: 5 > username: root > password: > socket: /var/run/mysqld/mysqld.sock-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Don''t know if it will help, but try something like development: adapter: mysql2 encoding: utf8 database: mblogdev username: nara password: <right-password> host: server_ip_addr_here -GR On Sep 12, 2011, at 1:42 PM, Nara wrote:> I also gem installed mysql, and changed everything in database.yml to > mysql. > Still the same issue with ActiveRecord failing to connect. I will go > back > to using mysql2, and hopefully, get some help on this group. I will > also try the mysql > blog author at excid3.com. If I can somehow get mysql2 to work, I will > post here. At this rate, it looks like I may have to try postgres > instead. > > Thanks > Nara > > > On Sep 10, 3:16 pm, Nara <nar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> I am newbie, and setup RoR 3.1 on Ubuntu 11.04. >> I followed everything on this blog, and the initial site came up fine >> on sqlite3:http://excid3.com/blog/ruby-on-rails-3-and-mysql-on-ubuntu-10-10/ >> >> Switching to mysql and running the rails server (rails s) displays >> this issue: >> ActiveRecord::ConnectionNotEstablished >> (ActiveRecord::ConnectionNotEstablished): >> >> I am pretty sure the database.yml is correct (shown later), that the >> database exists, and >> the user nara (myself) can access the database using the mysql client. >> I have tried rebooting my machine, but that does not help. >> >> Any ideas? >> Nara >> >> development: >> adapter: mysql2 >> encoding: utf8 >> reconnect: false >> database: mblogdev >> pool: 5 >> username: nara >> password: <right-password> >> socket: /var/run/mysqld/mysqld.sock >> >> # Warning: The database defined as "test" will be erased and >> # re-generated from your development database when you run "rake". >> # Do not set this db to the same as development or production. >> test: >> adapter: mysql2 >> encoding: utf8 >> reconnect: false >> database: mblogtest >> pool: 5 >> username: nara >> password: <right-password> >> socket: /var/run/mysqld/mysqld.sock >> >> production: >> adapter: mysql2 >> encoding: utf8 >> reconnect: false >> database: mblogprod >> pool: 5 >> username: root >> password: >> socket: /var/run/mysqld/mysqld.sock > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en. >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Mon, Sep 12, 2011 at 12:42 PM, Nara <nara19-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I also gem installed mysql, and changed everything in database.yml to > mysql. Still the same issue with ActiveRecord failing to connect. I will go > back to using mysql2Have you tried generating a new rails app starting out with mysql? e.g. % rails new myapp -d mysql I just did that as a quick test (on MySQL server 5.1.41) and it worked out of the box. Rails 3.1.0 / Ruby 1.9.2-p290 (on OS X, though that shouldn''t matter) -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://about.me/hassanschroeder twitter: @hassan -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi, if you''re new to Rails on Ubuntu DO NOT follow that blog post, it''s simply bad. Use RVM instead: http://gezope.github.com/rvm_install_script/ First I highly recommend to start with all default settings. If anything works properly and then you change DB for example and an error occurs - you can be sure that it was the mistake. Postgres is good, since you don''t need to change any SQL I think locally everything works fine, and remotely you''ll like Postgres later. HTH Let me know if you''ve further questions, cheers Zoli On Sep 11, 12:16 am, Nara <nar...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I am newbie, and setup RoR 3.1 on Ubuntu 11.04. > I followed everything on this blog, and the initial site came up fine > on sqlite3:http://excid3.com/blog/ruby-on-rails-3-and-mysql-on-ubuntu-10-10/ > > Switching to mysql and running the rails server (rails s) displays > this issue: > ActiveRecord::ConnectionNotEstablished > (ActiveRecord::ConnectionNotEstablished): > > I am pretty sure the database.yml is correct (shown later), that the > database exists, and > the user nara (myself) can access the database using the mysql client. > I have tried rebooting my machine, but that does not help. > > Any ideas? > Nara > > development: > adapter: mysql2 > encoding: utf8 > reconnect: false > database: mblogdev > pool: 5 > username: nara > password: <right-password> > socket: /var/run/mysqld/mysqld.sock > > # Warning: The database defined as "test" will be erased and > # re-generated from your development database when you run "rake". > # Do not set this db to the same as development or production. > test: > adapter: mysql2 > encoding: utf8 > reconnect: false > database: mblogtest > pool: 5 > username: nara > password: <right-password> > socket: /var/run/mysqld/mysqld.sock > > production: > adapter: mysql2 > encoding: utf8 > reconnect: false > database: mblogprod > pool: 5 > username: root > password: > socket: /var/run/mysqld/mysqld.sock-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.