Forum: Ruby on Rails Insertion failed in remote database

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Cf3efadeb0461f30a12039185319a2dc?d=identicon&s=25 Trupti Bhatt (railsdoubt)
on 2007-01-23 13:47
I am trying to connect to remote MySQL server through rails. It is able
to create table through db:migrate. but it gives following error
can not  connect to local mysql server through socket

while inserting data. we are trying to insert data through rhtml form .

i.e.

controller

SubController
  def r_save
        @sub = Sub.new
        @sub.name = params[:sub][:name]
  end
  @sub.save


end

plz. help me to solve the query..
we have made necessary correction in database.yml
8b22ad683842861ba91f68d5d32954db?d=identicon&s=25 Jason Norris (Guest)
on 2007-01-23 17:13
(Received via mailing list)
Are you using a different connection in config/database.yml? If you're
trying to connect to a local database, it means that the host is set to
localhost. Make sure that all of your connection settings are correct in
your database config. If you think they are all correct, post the
contents of that file here.
This topic is locked and can not be replied to.