[Instantrails-users] MySQL with root password

Elliot Smith elliot at townx.org
Mon Mar 27 16:18:35 EST 2006

Sometimes, there are issues with older clients talking to newer MySQL 
database servers. The issue is that users created in newer versions of 
MySQL use a different password hash; when older clients try to use the 
old password hash (shorter), MySQL complains, as it detects the use of 
old-style passwords against new style passwords in user records. I've 
had this problem with some versions of PHP talking to newer MySQL servers.

The solution is to manually amend the user table to revert user records 
to the old style password hash. So say you have a MySQL account 
"railsuser" intended for use with a Rails app. which is using the old 
client library. This user will have an entry in the mysql.user table, 
which you can revert to the old password using this SQL command:

UPDATE mysql.user SET Password=OLD_PASSWORD('password') WHERE 

(Obviously, you need to replace 'password' with the appropriate 
password. And you could do the same thing with the root user.)

This will set the railsuser's password to the old style hash.

Hope this helps.


Heikki Ylönen wrote:

> No, I didn't.
> So far the best clue is from the mysql log:
> "060306 18:53:54 [Warning] mysql.user table is not updated to new 
> password format; Disabling new password usage until 
> mysql_fix_privilege_tables is run"
> Maybe that is the problem? I couldn't run mysql_fix_privilege_tables 
> because there isn't that script.
> Phpmysql works ok with password.
> 2006/3/27, William (Bill) Froelich < wfroelich at dbsnow.com 
> <mailto:wfroelich at dbsnow.com>>:
>     Did you get this working?
>     I know I tried in the past and at one point had it working but now
>     I can't get it to work either.
>     Just wondering.
>     --Bill
>     ------------------------------------------------------------------------
>     *From:* instantrails-users-bounces at rubyforge.org
>     <mailto:instantrails-users-bounces at rubyforge.org>
>     [mailto:instantrails-users-bounces at rubyforge.org
>     <mailto:instantrails-users-bounces at rubyforge.org>] *On Behalf Of
>     *Heikki Ylönen
>     *Sent:* Wednesday, March 22, 2006 2:53 AM
>     *To:* instantrails-users at rubyforge.org
>     <mailto:instantrails-users at rubyforge.org>
>     *Subject:* [Instantrails-users] MySQL with root password
>     Has anyone changed InstantRails MySQL to use root password?
>     I have tried this couple of times with no success.
>     I get a lot of errors after:
>     - adding root password in phpmyadmin
>     - editing database.yml accordingly
>     I edited /phpmyadmin/config.inc.php to get phpmyadmin to work with
>     password. That's ok.
>     Problem is that i can't get Rails to connect to database. I guess
>     the problem is simple but I can't figure it out.
>     _______________________________________________
>     Instantrails-users mailing list
>     Instantrails-users at rubyforge.org
>     <mailto:Instantrails-users at rubyforge.org>
>     http://rubyforge.org/mailman/listinfo/instantrails-users
> -- 
> Heikki
>Instantrails-users mailing list
>Instantrails-users at rubyforge.org

More information about the Instantrails-users mailing list