[nSLUG] Rails and mysql

Rick Wightman wightman at unb.ca
Thu Mar 9 23:18:13 AST 2006


Hello,

I'm attempting to develop a simple Rails app that contacts a mysql  
server on another machine. Both machines are running FC4 with mysql  
5.0.16-standard. Previously the server had run 3.x. I have stopped  
the server, rpm -e all things sql I could find, removed /var/lib/ 
mysql and installed the server and client rpms for 5.0.16 (or at  
least that's what I think I did), and reset the root password. This  
would, I believe, have given me a clean slate with long passwords.


A client connection to the database reveals:

[rick at outweb newlife]$ mysql newlife_development -h tertius  -u root -p
Enter password:
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 14 to server version: 5.0.16-standard

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> show tables;
+-------------------------------+
| Tables_in_newlife_development |
+-------------------------------+
| Members                       |
+-------------------------------+
1 row in set (0.00 sec)

mysql>

which I'm happy with. BUT running the following on the client machine  
craps out:

[rick at outweb newlife]$ script/generate scaffold Member Admin
       exists  app/controllers/
       exists  app/helpers/
       exists  app/views/admin
       exists  test/functional/
   dependency  model
       exists    app/models/
       exists    test/unit/
       exists    test/fixtures/
    identical    app/models/member.rb
    identical    test/unit/member_test.rb
    identical    test/fixtures/members.yml
        error  Before updating scaffolding from new DB schema, try  
creating a table for your model (Member)
[rick at outweb newlife]$


This makes me think that it can't connect to the server(??!!)

The config/database.yml is listed as:

[rick at outweb config]$ more *.yml
# MySQL (default setup).  Versions 4.1 and 5.0 are recommended.
#
# Get the fast C bindings:
#   gem install mysql
#   (on OS X: gem install mysql -- --include=/usr/local/lib)
# And be sure to use new-style password hashing:
#   http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
   adapter: mysql
   database: newlife_development
   host: tertius
   username: xxxx
   password: xxxx
   socket: /var/lib/mysql/mysql.sock

where username and password match the previous commandline client  
connection.

My experience with all of this is quite thin. As always any  
illuminating information in any form is greatly appreciated.



Rick Wightman



!DSPAM:4410f16722451174472460!




More information about the nSLUG mailing list