# Substrtuct mysql help

**URL:** <https://www.ruby-forum.com/t/substrtuct-mysql-help/68332>\
**Category:** Rails\
**Created:** [September 11, 2006, 8:50pm UTC](https://www.ruby-forum.com/t/substrtuct-mysql-help/68332 "2006-09-11T20:50:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![roxah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/54ee81/32.png) [@roxah](https://www.ruby-forum.com/u/roxah)\
**Post date:** [September 11, 2006, 8:50pm UTC](https://www.ruby-forum.com/t/substrtuct-mysql-help/68332/1 "2006-09-11T20:50:29Z")

</div>

Thanks guys for trying to help me out, So heres my problem, I sent it to  
the tech support of DreamHost and copied the email I sent him and am  
going to post it here, so keep that in mind, thanks.

+++++++++++++++++++++++++++++++++++++++++++++++++++  
+++++++++++++++++++++++++++++++++++++++++++++++++++  
+++++++++++++++++++++++++++++++++++++++++++++++++++  
+++++++++++++++++++++++++++++++++++++++++++++++++++

Hello, Ive been having trouble setting up mysql to connect with my  
substrcut app, I have configured everyhting ok, Pasword, and port and  
SOCKET. Here is the problem:

heres my database file:

* * *

An example of my db file (database.yml):  
development:  
adapter: mysql  
socket: /var/run/mysqld/mysqld.sock  
database: substruct\_development  
username: Username  
password: Password  
host: [mysql.redesigntheory.com](http://mysql.redesigntheory.com)  
port: 3306

* * *

When I perform this step: cp -R vendor/plugins/substruct/db/\* db/

## I get a permission denied:

* * *

* * *

wiggum]$ cd [svn.redesigntheory.com](http://svn.redesigntheory.com)  
[wiggum]$ cp -R vendor/plugins/substruct/db/\* db/  
cp: cannot create regular file  
`db/migrate/.svn/text-base/003_add_rbac.rb.svn-base': Permission denied cp: cannot create regular file `db/migrate/.svn/text-base/001\_add\_user\_and\_contact.rb.svn-base’:  
Permission denied  
cp: cannot create regular file  
`db/migrate/.svn/text-base/002_add_tags.rb.svn-base': Permission denied cp: cannot create regular file `db/migrate/.svn/prop-base/003\_add\_rbac.rb.svn-base’: Permission denied  
cp: cannot create regular file  
`db/migrate/.svn/prop-base/001_add_user_and_contact.rb.svn-base': Permission denied cp: cannot create regular file `db/migrate/.svn/prop-base/002\_add\_tags.rb.svn-base’: Permission denied  
cp: cannot create regular file  
`db/migrate/.svn/props/003_add_rbac.rb.svn-work': Permission denied cp: cannot create regular file `db/migrate/.svn/props/001\_add\_user\_and\_contact.rb.svn-work’: Permission  
denied  
cp: cannot create regular file  
`db/migrate/.svn/props/002_add_tags.rb.svn-work': Permission denied cp: cannot create regular file `db/migrate/.svn/wcprops/003\_add\_rbac.rb.svn-work’: Permission denied  
cp: cannot create regular file  
`db/migrate/.svn/wcprops/001_add_user_and_contact.rb.svn-work': Permission denied cp: cannot create regular file `db/migrate/.svn/wcprops/002\_add\_tags.rb.svn-work’: Permission denied  
cp: cannot create regular file `db/migrate/.svn/entries': Permission denied cp: cannot create regular file `db/migrate/.svn/empty-file’: Permission  
denied  
cp: cannot create regular file `db/migrate/.svn/README.txt': Permission denied cp: cannot create regular file `db/migrate/.svn/format’: Permission  
denied  
cp: cannot create regular file `db/migrate/.svn/dir-wcprops’: Permission  
denied

* * *

* * *

* * *

Then when I do this step:

* * *

* * *

* * *

wiggum]$ chmod +w db/schema.rb  
[wiggum]$ rake db:schema:load  
(in /home/.lemon/strikezero/svn.redesigntheory.com)  
– create\_table(“content\_node\_types”, {:force=\>true})  
rake aborted!  
Can’t connect to local MySQL server through socket  
‘/var/run/mysqld/mysqld.sock’ (2)

* * *

* * *

* * *

As you can see in this it says it cant find the socket but as you can  
see in the database file it Points to the right directory for the  
socket.

because when i do a “[wiggum]$ mysql\_config --socket” command I get :  
“[wiggum]$ mysql\_config --socket  
/var/run/mysqld/mysqld.sock”

So this leads me to suspect that its pointing to the socket, but its not  
there, Is this a problem on your end, and if not what can I do to  
resolve this.

Thank you for your prompt responce.

Seems fine too me… Is this an error on your end? thanks

[Redesigntheory.com](http://Redesigntheory.com)  
Support

+++++++++++++++++++++++++++++++++++++++++++++++++++  
+++++++++++++++++++++++++++++++++++++++++++++++++++  
+++++++++++++++++++++++++++++++++++++++++++++++++++  
+++++++++++++++++++++++++++++++++++++++++++++++++++

Please can anyone help, thanks alot guys!

---

<div class="post-metadata">

**Author:** ![roxah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/54ee81/32.png) [@roxah](https://www.ruby-forum.com/u/roxah)\
**Post date:** [September 11, 2006, 9:08pm UTC](https://www.ruby-forum.com/t/substrtuct-mysql-help/68332/2 "2006-09-11T21:08:56Z")

</div>

Okay this really hard to read and I can’t figure out what you’re saying  
and what Dreamhost is saying. But you connect to MySQL EITHER through  
a socket or a host. In the case of Dreamhost you always connect  
through a host (as far as I know).

The other issue I run into on Dreamhost is that if I’m running commands  
via ssh for a production site I need to explicitly set the mode to  
production like this:

RAILS\_ENV=production rake migrate

As for the copying files… well it looks like only the subversion  
files didn’t copy which shouldn’t really be an issue, but if you want  
to figure it out go look up a unix permissions tutorial.

Bryan Roxah wrote:

> As you can see in this it says it cant find the socket but as you  
> can

---

<div class="post-metadata">

**Author:** ![roxah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/54ee81/32.png) [@roxah](https://www.ruby-forum.com/u/roxah)\
**Post date:** [September 11, 2006, 10:09pm UTC](https://www.ruby-forum.com/t/substrtuct-mysql-help/68332/3 "2006-09-11T22:09:46Z")

</div>

dasil003 Thanks I’ll try this and update u guys

oh and about the post, sorry I was stoned.

---

<div class="post-metadata">

**Author:** ![roxah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/54ee81/32.png) [@roxah](https://www.ruby-forum.com/u/roxah)\
**Post date:** [September 11, 2006, 9:24pm UTC](https://www.ruby-forum.com/t/substrtuct-mysql-help/68332/4 "2006-09-11T21:24:59Z")

</div>

I just noticed this happening lately. Every time I restart the Webrick  
server and load the first page, I get the following info at the bottom  
of my page:

HTTP/1.1 200 OK Cache-Control: no-cache Connection: Keep-Alive Date:  
Mon, 11 Sep 2006 19:03:41 GMT Content-Type: text/html; charset=UTF-8  
Server: WEBrick/1.3.1 (Ruby/1.8.2/2004-12-25) Content-Length: 44024  
Set-Cookie: \_session\_id=

It only does this on the first page and browsing the site afterwards it  
does not show that. Where is this coming from?

Best Regards,

Tamim

---

<div class="post-metadata">

**Author:** ![roxah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/54ee81/32.png) [@roxah](https://www.ruby-forum.com/u/roxah)\
**Post date:** [September 12, 2006, 6:22am UTC](https://www.ruby-forum.com/t/substrtuct-mysql-help/68332/5 "2006-09-12T06:22:27Z")

</div>

OK SO I GOT THIS FIXED!!!

SUBSTRUCT DATABAse, (or rails) yml file is mesed up or something, but i  
used another one like this:

login: &login  
adapter: mysql  
username: username  
password: password  
host: [mysql.yoursite.com](http://mysql.yoursite.com)

development:  
\<\<: \*login  
database: myapp\_development

test:  
\<\<: \*login  
database: myapp\_test

production:  
\<\<: \*login  
database: myapp\_production

and this worked like a charm!!!

now to pack a bowl…

---

<div class="post-metadata">

**Author:** ![roxah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/54ee81/32.png) [@roxah](https://www.ruby-forum.com/u/roxah)\
**Post date:** [September 12, 2006, 2:51am UTC](https://www.ruby-forum.com/t/substrtuct-mysql-help/68332/6 "2006-09-12T02:51:18Z")

</div>

Bryan Roxah wrote:

> 

dasil003, I did the fixes including deleteing the PORT: and SOCKET:  
lines from my database file, and ran the command you told me too, and  
now got this error…

* * *

# [wiggum]$ RAILS\_ENV=production rake migrate (in /home/.lemon/strikezero/svn.redesigntheory.com) == AddUserAndContact: migrating

– add\_column(:questions, :email\_address, :string, {:limit=\>50})  
rake aborted!  
MysqlError: Table ‘substruct\_production.questions’ doesn’t exist: ALTER  
TABLE questions ADD `email_address` varchar(50)

(See full trace by running task with --trace)  
[wiggum]$

* * *

any help?
