[nSLUG] Rails and mysql

Miles Thompson miles at allnovascotia.com
Fri Mar 10 08:52:53 AST 2006


At 11:18 PM 3/9/2006, Rick Wightman wrote:

>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

Rick,

I'm no Linux expert, and MySQL hasn't created enough problems for me to 
become expert in it. <g> This is more likely a MySQL problem than a Linux one.

Does the client you're trying to connect from know about host tertius? Have 
you tried connecting by IP number?

Have you checked the troubleshooting section in the MySQL docs? There are 
scores of reasons why connections fail, including upgrades. Could 
the  other machine have an out-of-date client? Here's the URL:
         http://dev.mysql.com/doc/refman/5.0/en/access-denied.html

There is also the possibility that the rpm's are screwed up. Try building 
from source, I have had to do that.

Finally, don't forget that MySQL 5.x is still somewhat experimental.

This probably hasn't helped you, but the list in the MySQL docs may provide 
a troubleshooting structure.

Good luck - Miles



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.375 / Virus Database: 268.2.1/278 - Release Date: 3/9/2006



!DSPAM:44117cc045261081611947!




More information about the nSLUG mailing list