SUSE Linux Enterprise Server 10 SP2
Subscription Management Tool (SMT)
The MySQL root password has become corrupted, and SMT will not start up correctly. This is seen when trying an 'rcsmt restart':
Restarting service MySQL
Shutting down service MySQL
Shutting down CRON daemon
Starting CRON daemon
DBIx::Transaction connect('database=smt;host=localhost','smt',...) failed: Access denied for user
'smt'@'localhost' (using password: YES) at /usr/lib/SMT/bin/smt-db line 57
Database initialization failed. Try to run '/usr/lib/SMT/bin/smt-db setup' .
When user then tries to run the 'smt-db setup' command, this error shows up:
mysql password for user root:
Cannot connect to database: DBI connect('database=;host=localhost','root',...) failed: Access denied for user
'root'@'localhost' (using password: YES) at /usr/lib/SMT/bin/smt-db line 244
Furthermore, using the Yast2 GUI tool for SMT, trying to change the password for the mysql database user will fail, as the root password is needed.
The following commands should allow us to reset the corrupted root password. Run these from a terminal or SSH session to the server (you need to be root to run these commands):
rcsmt stop
rcmysql stop
mysqld_safe --skip-grant-tables &
That last command should start up the mysql service allowing us to now login to MySQL while skipping any security checks.
mysql --user=root mysql
This command should now place us at a mysql> prompt.
UPDATE user SET Password=PASSWORD('newpwd') WHERE User='root';
flush privileges;
exit;
After the UPDATE command, we should now see a message that the query was ok, and 2 rows were affected and changed. Also, substitute your own new root password for newpwd. We must now kill the still running mysql processes. You can run either 'pkill mysql', or 'ps aux | grep mysql', look for the thread numbers, and then 'kill xxxx', where xxxx represents the thread # of the mysql processes.
At this point, we should be able to now start the smt service back up, and have it load and work correctly (rcsmt start). If that doesn't work, try running the 'smt-db setup' command again, as we now know the root password.
This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.