Re: Rails & MySQL login problem (#42000Access denied for user)
- From: Lou Vanek <vanek@xxxxxxx>
- Date: Sat, 10 Dec 2005 20:26:47 +0900
When you look at field mysql.`user`.password do you see strings that are
about 16 characters long? If so, then for some reason old passwords are
being used (they would be much longer, 41 bytes, if they are new passwords).
If you are currently trying to log on with a user that has new passwords,
then I'd try updating the password to the old, 16-character hash format.
On the other hand, if you trying to log on with a user that has an old
password, then you might try updating the password to the new, 41-character
hash format.
To change to an old-style password:
mysql> SET PASSWORD FOR 'members'@'localhost' = OLD_PASSWORD('the_password');
To change to a new-style password:
mysql> SET PASSWORD FOR 'members'@'localhost' = PASSWORD('the_password');
Then either restart the mysql server or run,
mysqladmin reload
You may also want to try changing 'host' from 'localhost' to the actual IP
address, '127.0.0.1' in the yml file.
If you cannot get any of this to work I suggest rolling back the
gems until the problem is fixed.
Stephan wrote:
Yan-Fa Li wrote:
Jeremy Kemper wrote:
On Dec 9, 2005, at 2:32 PM, Lou Vanek wrote:
It looks like ActiveRecord 1.13.1 for some reason is now trying to
log on using the new authentication method that MySQL 4.1+ uses.
A bug has been filed for this.
Because AR bundles the latest version of the pure-Ruby mysql driver
(0.2.6) along with a patch to support 4.1/5.0 servers. The patch has
a bug which breaks compatibility with 3.23/4.0.
In the mean time you may want to either revert your rails gems,
update the database, or perform some fu on mysql.rb 'real_connect'.
Or install the mysql-ruby C bindings, which have always worked:
gem install mysql
jeremy
On FC4 you may need to type:
sudo gem install mysql -- --with-mysql-lib=/location/of/your/mysqllibs
e.g. sudo gem install mysql -- --with-mysql-lib=/usr/lib64/mysql
on an AMD64 system
Yan
Thanks for your help, but I still didn't get it working.
I have MySQL version 4.1.15 and I have set old_passwords=0 in the MySQL
config file. So the MySQL version should not be a problem here, right?
I installed the gem with the command given above, with the following
result:
gem install mysql -- --with-mysql-lib=/usr/lib/mysql
<...cut...>
Successfully installed mysql-2.7
After this the problem remains. There is a slight difference in the
error message, it is now: "Access denied for user 'members'@'localhost'
to database 'dev_members'", so the error number is missing now.
Any more ideas?
Stephan
.
Relevant Pages
- [UNIX] Inter7 VPopmail DB Password Problem
... VPopmail contains the SQL password in one of its binaries. ... VPopmail version 4.10.35 and prior (When using MySQL) ... they all contain the passwords as well. ... (Securiteam) - Re: [OT] Mysql advice
... The passwords are the same. ... The zenoss install will ask you for the mysql root password at which time you give it and all is well with the world. ... antivirus y antispam ¡gratis! ... (Fedora) - RE: [PHP] Adding encryption to passwords
... You can then use the decode() functions in your matching queries. ... There are other built-in encryptions functions in MySQL you can explore. ... I am storing the passwords into a mysql table as raw text (I know not so ... (php.general) - Re: Synchronize Active Directory with MySQL
... Then it would make sense to me to put all of the passwords from MySQL into ... >>> systems runs on an active directory and the other on a mysql database. ... >>> Lukas ... (microsoft.public.windows.server.active_directory) - Re: Code for connecting to SQL Server?
... I am working windows here. ... Gem:> gem install mysql ... (comp.lang.ruby) |
|