My rails project was working (for the most part). I updated rails, restarted everything, and now when I fire up my rails app (without changing any code), I suddenly get an InvalidStatement error:
"Lost connection to MySQL server during query: SELECT * FROM man_departments WHERE (man_departments.id = 3) LIMIT 1"
So, I tinkered with the "database.yml" settings and this is what I discovered:
I AM UNABLE to make my rails app work with the exact same settings which I had before, when my rails app was working fine.
I AM ABLE to make my rails app work if I change the "username"/"password" to "root"/"" (on my dev machine there is a MySQL user named "root" with no password). For some strange reason it won't take the previously working username/password.
I have made no changes to my MySQL user accounts.
My working database.yml ...
development:
adapter: 'mysql'
database: 'rominato_development'
socket: 'localhost'
username: 'root'
password: ''
# Warning: The database defined as 'test' will be erased and
# re-generated from your development database when you run 'rake'.
# Do not set this db to the same as development or production.
test:
adapter: 'mysql'
database: 'rominato_test'
socket: 'localhost'
username: 'root'
password: ''
production:
adapter: 'mysql'
database: 'rominato_production'
socket: 'localhost'
username: 'root'
password: ''
My previously working, but now non-working database.yml ...
development:
adapter: 'mysql'
database: 'rominato_development'
socket: 'localhost'
username: 'rominato'
password: '********'
# Warning: The database defined as 'test' will be erased and
# re-generated from your development database when you run 'rake'.
# Do not set this db to the same as development or production.
test:
adapter: 'mysql'
database: 'rominato_test'
socket: 'localhost'
username: 'rominato'
password: '********'
production:
adapter: 'mysql'
database: 'rominato_production'
socket: 'localhost'
username: 'rominato'
password: '********'
My OS is ...
Microsoft Windows XP [Version 5.1.2600]
My MySQL version is ...
5.0.15
My Ruby version is ...
C:\>ruby -v
ruby 1.8.2 (2004-12-25) [i386-mswin32]
My Gems are ...
*** LOCAL GEMS ***
actionmailer (1.1.3, 1.1.2)
Service layer for easy email delivery and testing.
actionpack (1.11.0, 1.10.2)
Web-flow and rendering framework putting the VC in MVC.
actionwebservice (0.9.3, 0.9.2)
Web service support for Action Pack.
activerecord (1.13.0, 1.12.2)
Implements the ActiveRecord pattern for ORM.
activesupport (1.2.3, 1.2.2)
Support and utility classes used by the Rails framework.
fxri (0.3.2)
Graphical interface to the RI documentation, with search engine.
fxruby (1.2.6)
FXRuby is the Ruby binding to the FOX GUI toolkit.
postgres-pr (0.4.0)
A pure Ruby interface to the PostgreSQL (>= 7.4) database
rails (0.14.3, 0.14.2)
Web-application framework with template engine, control-flow layer,
and ORM.
rake (0.6.2)
Ruby based make-like utility.
sources (0.0.1)
This package provides download sources for remote gem installation