SitePoint Sponsor

User Tag List

Results 1 to 18 of 18

Hybrid View

  1. #1
    SitePoint Evangelist
    Join Date
    Jun 2001
    Location
    Houston, Texas, USA
    Posts
    559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Connecting to MySql on Dreamhost

    Is anyone here using Dreamhost to develop Rails?

    I can't even get passed step one.

    How do I configure the database.yml file so that I don't get the following error?

    Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)

    Thanks in Advance!!

  2. #2
    SitePoint Evangelist
    Join Date
    Jun 2004
    Location
    California
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I use dreamhost and I connect just fine. What host (for the database) are you using? You're not using 'localhost' are you?

  3. #3
    SitePoint Evangelist
    Join Date
    Jun 2001
    Location
    Houston, Texas, USA
    Posts
    559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you have an example database.yml file so I can see what you do?

  4. #4
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)

  5. #5
    SitePoint Evangelist
    Join Date
    Jun 2001
    Location
    Houston, Texas, USA
    Posts
    559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the link.

    I wish I could just get the output of an actual Dreamhost database.yml that works.

    I guess I'll contact support today.

    Thanks!

  6. #6
    SitePoint Evangelist
    Join Date
    Jun 2004
    Location
    California
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    here is an example database.yml:

    Code:
     development:
       adapter: mysql
       host: my-db.mitchellhashimoto.com
       user: mitchell
       pass: ***...
       database: my_db
    just like that...

  7. #7
    SitePoint Wizard samsm's Avatar
    Join Date
    Nov 2001
    Location
    Atlanta, GA, USA
    Posts
    5,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Remember the host! Localhost is the default for most database setups but that is always wrong on Dreamhost.

    Have you set up a database yet? That is also a necessary step.
    Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?

  8. #8
    SitePoint Evangelist
    Join Date
    Jun 2004
    Location
    California
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Right.

    Also, remember that on Dreamhost it takes about a day for your DB host to start working because the subdomain has to propagate. And also, if you are waiting for it to propagate and wish to find the exact IP of it, just open up a SSH client and log in. Then do a:
    Code:
     wget http://my-db-host.my-domain.com
    And you can find out the IP (even though the wget wont work ) then just use the IP as the host.

  9. #9
    SitePoint Wizard samsm's Avatar
    Join Date
    Nov 2001
    Location
    Atlanta, GA, USA
    Posts
    5,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by xmitchx
    Also, remember that on Dreamhost it takes about a day for your DB host to start working because the subdomain has to propagate.
    It isn't instant, but it takes less than a day. 10 minutes is the mode I've experienced.

    Once you can get to phpMyAdmin through the control panel, the domain works.
    Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?

  10. #10
    SitePoint Evangelist
    Join Date
    Jun 2001
    Location
    Houston, Texas, USA
    Posts
    559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My database.yml file didn't have the host line in it when it was generated.

    It appears to have worked after adding it.

    I ran the scaffold command and didn't get any errors. I can see that the pieces have been created.

    Thanks for all of the help!

    Now I have a new problem. I can't get to the scaffold. Is there something special I need to do with the dreamhost domain settings? or htaccess files?

    I was expecting it to show up here: http://www.boardrunners.com/post/admin

  11. #11
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Are you running FastCGI on your domain? If so, be sure your .htaccess file forwards requests to dispatch.fcgi instead of dispatch.cgi (or vice-versa if you're running your Rails app as CGI, which is really slow and not recommended).

  12. #12
    SitePoint Evangelist
    Join Date
    Jun 2001
    Location
    Houston, Texas, USA
    Posts
    559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you have an example htaccess file also?

    Getting started is always the toughest part, huh? :-)

  13. #13
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    If you have a line that looks like this:
    Code:
    RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
    You'll have to add an "f" after the last dot if you're using FastCGI.

  14. #14
    SitePoint Evangelist
    Join Date
    Jun 2004
    Location
    California
    Posts
    440
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by vgarcia
    If you have a line that looks like this:
    Code:
    RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
    You'll have to add an "f" after the last dot if you're using FastCGI.
    But wouldnt doing this cause changed source files to not reload?

  15. #15
    SitePoint Wizard samsm's Avatar
    Join Date
    Nov 2001
    Location
    Atlanta, GA, USA
    Posts
    5,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by xmitchx
    But wouldnt doing this cause changed source files to not reload?
    Glad you asked.

    When you change files in the app directory, go ahead and kill all the active fcgi dispatch processes. The new processes that apache spawns will reflect your changes.

    Really, you should be testing stuff in your localhost environment and then uploading it once you are sure it works, minimizing the above step.
    Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?

  16. #16
    SitePoint Wizard samsm's Avatar
    Join Date
    Nov 2001
    Location
    Atlanta, GA, USA
    Posts
    5,011
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by rgremill
    I was expecting it to show up here: http://www.boardrunners.com/post/admin
    ruby script/generate scaffold whatever

    The scaffold should be accessible at:
    http://example.com/whatever

    I think CGI and FCGI are active on Dreamhost (when you check the box for FCGI to be available) so I expect your .htaccess is fine either way.
    Using your unpaid time to add free content to SitePoint Pty Ltd's portfolio?

  17. #17
    SitePoint Evangelist
    Join Date
    Jun 2001
    Location
    Houston, Texas, USA
    Posts
    559
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the help. I found this link http://wiki.dreamhost.com/index.php/Ruby_on_Rails

    I'll be studying it tonight!!

    I may be looking for a Rails tutor if anyone is interested!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •