SitePoint Sponsor |
|
User Tag List
Results 1 to 18 of 18
Thread: Connecting to MySql on Dreamhost
-
Nov 13, 2005, 23:08 #1
- 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!!
-
Nov 13, 2005, 23:10 #2
- 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?
-
Nov 14, 2005, 08:03 #3
- 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?
-
Nov 14, 2005, 08:17 #4
See if this helps you: http://wiki.rubyonrails.com/rails/pages/database.yml
-
Nov 14, 2005, 09:07 #5
- 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!
-
Nov 14, 2005, 09:09 #6
- 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
-
Nov 14, 2005, 09:29 #7
- 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?
-
Nov 14, 2005, 09:34 #8
- 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
) then just use the IP as the host.
-
Nov 14, 2005, 09:39 #9
- Join Date
- Nov 2001
- Location
- Atlanta, GA, USA
- Posts
- 5,011
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by xmitchx
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?
-
Nov 14, 2005, 09:42 #10
- Join Date
- Jun 2004
- Location
- California
- Posts
- 440
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by samsm
-
Nov 14, 2005, 10:13 #11
- 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
-
Nov 14, 2005, 10:41 #12
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).
-
Nov 14, 2005, 10:46 #13
- 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? :-)
-
Nov 14, 2005, 10:48 #14
If you have a line that looks like this:
Code:RewriteRule ^(.*)$ dispatch.cgi [QSA,L]
-
Nov 14, 2005, 11:01 #15
- Join Date
- Nov 2001
- Location
- Atlanta, GA, USA
- Posts
- 5,011
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by rgremill
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?
-
Nov 14, 2005, 12:55 #16
- 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!
-
Nov 14, 2005, 18:31 #17
- Join Date
- Jun 2004
- Location
- California
- Posts
- 440
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by vgarcia
-
Nov 14, 2005, 22:20 #18
- Join Date
- Nov 2001
- Location
- Atlanta, GA, USA
- Posts
- 5,011
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by xmitchx
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?
Bookmarks