I have searched the forums, searched google, etc for the past 3 days and
have not found a solution that will work. Any help is greatly
appreciated and at this point I have no problem paying for help. I have
a paypal account.
I was developing my rails project on a server that had mysql 5. We
finished development and needed to move it over to the client server,
their server has mysql 4.1. Anyways, everything was installed properly
on this server: ruby, ruby gems, rails, mysql, etc.
I copied over my rails project directory to the new server, reset up my
database.yml file and ran all of my tests to make sure everything was
working. I got a ton of errors that all said:
“ActiveRecord::StatementInvalid: Mysql::Error: Lost connection to MySQL
server during query:”
The usernames and passwords in the database.yml file were correct, I
checked them 3-4 times. When I run “mysql -u root -p” in my console I
successfully log in. I can run any mysql query I wish. When I use those
same usernames and passwords in the database.yml file I lose connection.
Here is the strange part:
I edited the root mysql user and removed the password. I then removed
the password from database.yml. That fixed it, no errors or anything. I
know my password wasn’t wrong because I checked it numerous times and
could successfully log in with the same username and password doing
mysql -u root -p. So providing a password breaks everything.
I read on the internet that mysql 4.1 and mysql 5 had different password
structures, so I’m assuming that’s the problem here, but I have no idea
how to fix this. Since I developed my rails app on a server with mysql 5
and then moved it to a server that has mysql 4.1 does rails think I have
5? The ONLY thing I copied over from the old server was my rails project
directory, the single directory that contains your app, config, db, etc
Once again any help is greatly appreciated. I am clueless as to what is
causing this and will pay for help if need be.
Thanks for your time.