How to reset MYSQL password for user root

Hi, I'm using turnkey redmine 2.2.3 appliance. Unfortunately I forgot MYSQL root password and can't find procedure to reset password. I found this solutin on: 

http://www.cyberciti.biz/faq/mysql-reset-lost-root-password/

...but itisn't work for the redmine appliance. I'm not so familiar with lunux and MYSQL DB, and I'm afraid to lose imprtant projects on my redmine.

Can you help me on this problem? I'll be gratefull.  

Eric (tssgery)'s picture

I found a newer article, but the steps look the same (or very close).

Follow the steps at:

http://www.rackspace.com/knowledge_center/article/mysql-resetting-a-lost-mysql-root-password

If that doesn't work... all is not lost. The userid/password combination that redmine is uing is stored in /var/www/redmine/config/database.yml

You should be able to dump the database with that combination and restore the data to a new database.

The mysql dump command will look something like:

mysqldump --user=redmine --password --all-databases > redmine.databases.sql

This will prompt you for the 'redmine' user password (found in the database.yml file mentioned above) and dump all the databases they have access to. You should then be able to load the dump into another mysql instance that you do know the password to.

 


Thank you Eric,

I'll try this and leave you a feedback.

Liraz Siri's picture

Try rerunning the initialization routine as root:

turnkey-init

You can also run just the mysqlconf.py script directly:

/usr/lib/inithooks/bin/mysqlconf.py --user=root --pass="YOUR_DB_PASS"

FWIW, it uses the debian-sys-maint account credentials.

Thank you again Eric, it woked.

 

Have a nice day!

Post new comment