Forum: Ruby on Rails Can't connect to MySQL server on 'localhost' (111) (Mysql2::Error)

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.
7d7e87a51f9503bb3de6dcfcf94e2eb7?d=identicon&s=25 Ecoder 108 (ecoder108)
on 2016-01-05 10:01
Attachment: redmine-on-browser.jpg (200 KB)
Attachment: redmine-on-browser.jpg (200 KB)
Hello Guys,

I am a newbe on Ruby on Rails. I love Redmine so I have just installed
Redmine on BlueHost, Everything is ok except when starting with browser
it shows "Can't connect to MySQL server on 'localhost' (111)
(Mysql2::Error)".

I have spent for many hours on forums however I am not lucky. Please
share to me if you experienced I appreciate all of you.

Thank you,
4c6bde00168d595053c09aac7e487f8e?d=identicon&s=25 Colin Law (Guest)
on 2016-01-05 11:47
(Received via mailing list)
On 5 January 2016 at 09:01, Ecoder 108 <lists@ruby-forum.com> wrote:
> Hello Guys,
>
> I am a newbe on Ruby on Rails. I love Redmine so I have just installed
> Redmine on BlueHost, Everything is ok except when starting with browser
> it shows "Can't connect to MySQL server on 'localhost' (111)
> (Mysql2::Error)".
>
> I have spent for many hours on forums however I am not lucky. Please
> share to me if you experienced I appreciate all of you.

It is generally best to look in log/development.log for errors, or
alternatively in the server window.  That way you can copy/paste the
relevant section here.  It is then much easier for us to look at the
log and work out what is going wrong.

First though, what happens if you run
rake db:migrate

Colin
7d7e87a51f9503bb3de6dcfcf94e2eb7?d=identicon&s=25 Ecoder 108 (ecoder108)
on 2016-01-05 15:10
Attachment: production.log (20 KB)
Attachment: development.log (20 KB)
Thanks Colin,

Currently, when I run "# rake db:migrate", nothing happen. It is done
normal.

I will be pasting more information for the issue as below:

1. I followed the bluehost's document at:
https://my.bluehost.com/cgi/help/redmine
2. # rails generate controller First list
   identical  app/controllers/first_controller.rb
       route  get 'first/list'
      invoke  erb
       exist    app/views/first
   identical    app/views/first/list.html.erb
      invoke  test_unit
   identical    test/controllers/first_controller_test.rb
      invoke  helper
   identical    app/helpers/first_helper.rb
      invoke    test_unit
      invoke  assets
      invoke    js
   identical      app/assets/javascripts/first.js
      invoke    css
   identical      app/assets/stylesheets/first.css
3. I also attached development.log and production.log

Thanks,
4c6bde00168d595053c09aac7e487f8e?d=identicon&s=25 Colin Law (Guest)
on 2016-01-05 16:08
(Received via mailing list)
On 5 January 2016 at 14:10, Ecoder 108 <lists@ruby-forum.com> wrote:
>    identical  app/controllers/first_controller.rb
>       invoke    js
>    identical      app/assets/javascripts/first.js
>       invoke    css
>    identical      app/assets/stylesheets/first.css
> 3. I also attached development.log and production.log
>
> Thanks,
>
> Attachments:
> http://www.ruby-forum.com/attachment/11209/production.log
> http://www.ruby-forum.com/attachment/11210/development.log

I meant to copy/paste the section of the log showing the error, not
just attach the whole log.  By doing that you are asking me to
download it and pour over it looking for the error.

In this case the server window output is probably better.  Start the
server then attempt to open the page from the browser.  You should see
the error in the server window.  Then copy/paste the complete output
from the server window, from starting the server to the error.

Also which versions of ruby (ruby -v) and rails (rails -v) are you
using, and on which operating system.

Colin
This topic is locked and can not be replied to.