I can''t seem to connect to a remote database. Here is what I''ve tried. the database,username,password, and host have been changed to protect the innocent. development: adapter: mysql database: database username: username password: password host: host port: 3306 Here is the error /usr/lib/ruby/1.8/yaml.rb:133:in `load'': syntax error on line 11, col 2: ` password: password'' (ArgumentError) I''ve checked to make sure that the username,password,database, and host are correct. Can anyone help? -- Posted via http://www.ruby-forum.com/.
charlie bowman wrote:> I can''t seem to connect to a remote database. Here is what I''ve tried. > the database,username,password, and host have been changed to protect > the innocent. > > development: > adapter: mysql > database: database > username: username > password: password > host: host > port: 3306 > > Here is the error > /usr/lib/ruby/1.8/yaml.rb:133:in `load'': syntax error on line 11, col 2: > ` password: password'' (ArgumentError) > > I''ve checked to make sure that the username,password,database, and host > are correct. Can anyone help?First, check the leading space isn''t a tab (caught me out more than once...), then check there aren''t any yaml-special characters in the username or the password... Can''t think of any other likely issues without more info. -- Alex
Damon Clinkscales
2006-Jan-17 13:53 UTC
[Rails] Re: database.yml and remote mysql database
charlie bowman <cbowmanschool@...> writes:> > I can''t seem to connect to a remote database.charlie, try typing it again in a new file. No tabs, no pasted characters. Should parse. -damon http://damonclinkscales.com/
Hi, you can try this: ActiveRecord::Base.establish_connection(:adapter => "mysql", :host => "1.2.3.4", :port => 1234, :database => "dbName", :username => "user", :password => "pwd") hope this will help Saiho --- charlie bowman <cbowmanschool@yahoo.com> wrote:> I can''t seem to connect to a remote database. Here > is what I''ve tried. > the database,username,password, and host have been > changed to protect > the innocent. > > development: > adapter: mysql > database: database > username: username > password: password > host: host > port: 3306 > > Here is the error > /usr/lib/ruby/1.8/yaml.rb:133:in `load'': syntax > error on line 11, col 2: > ` password: password'' (ArgumentError) > > I''ve checked to make sure that the > username,password,database, and host > are correct. Can anyone help? > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >If God really exists, I would like to know what the dinosaurs have done to deserve their extinction. Water is unknown to fishes, until they discover air. http://www.geocities.com/sayoyo/ __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Thank you! I use a tab stop of 2 to seperate the values from the keys and that broke the yaml. Is that norman? Can you never use tabs in yaml? Damon Clinkscales wrote:> charlie bowman <cbowmanschool@...> writes: > >> >> I can''t seem to connect to a remote database. > > charlie, > > try typing it again in a new file. No tabs, no pasted characters. > Should parse. > > -damon > http://damonclinkscales.com/-- Posted via http://www.ruby-forum.com/.
Any decent text editor should give you the option to convert tabs to spaces. Use it! Tab characters are interpreted differently than spaces, so it will cause Rails to barf on your YAML if you include tabs. -Will On 1/17/06, charlie bowman <cbowmanschool@yahoo.com> wrote:> > Thank you! I use a tab stop of 2 to seperate the values from the keys > and that broke the yaml. Is that norman? Can you never use tabs in > yaml? > > > > Damon Clinkscales wrote: > > charlie bowman <cbowmanschool@...> writes: > > > >> > >> I can''t seem to connect to a remote database. > > > > charlie, > > > > try typing it again in a new file. No tabs, no pasted characters. > > Should parse. > > > > -damon > > http://damonclinkscales.com/ > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060117/02bb02d5/attachment.html
charlie bowman wrote:> Thank you! I use a tab stop of 2 to seperate the values from the keys > and that broke the yaml. Is that norman? Can you never use tabs in > yaml?Never. Check http://www.yaml.org/faq.html :-) -- Alex