I can access MySQL using phpmyadmin, but not with command line.I tried many ways with several versions.Some are official, some are online blogs.None is working.
For the specific version (latest 4.0.4), I change password following official documents.
Reset password lost without admin redmine account but with admin redmine database account
Found in file /app/models/user.rb: 'The hashed password is stored in the following form: SHA1(salt + SHA1)'
So you can reset password in two steps:
- clear salt
- calculate sha1(sha1(new_password))
For example for the password "password" (without quote) it will be "353e8061f2befecb6818ba0c034c632fb0bcae1b"
You have to go to redmine database, find "users" table, find user to reset password, clear "salt" field's user and put "353e8061f2befecb6818ba0c034c632fb0bcae1b" in "hashed_password" field's user and log to redmine with new password 'password' (without quote). To do this redmine database changes, do the following from command line in the operating system where Redmine is working:
note user and password from a file config/database.yml.
execute command: mysql -u -p
execute: UPDATE users SET hashed_password='353e8061f2befecb6818ba0c034c632fb0bcae1b' WHERE login='admin';
execute: UPDATE users SET salt='' WHERE login='admin';
Now you can go to Redmine login web page to login as user admin with 'password' as password.
And I failed to install 2.6 version(I though maybe old version can smoothly restore my backup data), following this:
I have tried console command method:
./rails console production
ausr.password = 'some_strong_password'
NoMethodError: undefined method
passwd_changed_on=' for #<User:0x0000000746df00>salt_password'
from app/models/user.rb:159:in `update_hashed_password'
I have been chasing my tail all day and yesterday, but I haven't got anything done!What a waste of time!
I am completely lost and frustrated.