SUSE Support

Here When You Need Us

How to Change the MySQL password in SuSE Linux Enterprise Server 10 and 11

This document (7009745) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 10 Service Pack 1
SUSE Linux Enterprise Server 10 Service Pack 2
SUSE Linux Enterprise Server 10 Service Pack 3
SUSE Linux Enterprise Server 10 Service Pack 4
SUSE Linux Enterprise Server 11 Service Pack 1
SUSE Linux Enterprise Server 11 Service Pack 2

Situation

How to Change the MySQL password in SuSE Linux Enterprise Server 10 and 11

Resolution

Steps to change the administrator password on SLES10 and 11:

1.) Ensure that mysqld and mysql aren't loaded
rcmysql stop
pkill mysql

2.) Run the following command from the server to load mysql without reading in user accounts
mysqld_safe --skip-grant-tables &

3.) Hit Enter to return to the command prompt

4.) Launch the mysql console and load the mysql database
mysql --user=root mysql

5.) Change the password
UPDATE user SET Password=PASSWORD('newpassword') WHERE User='root';
flush privileges;
exit;

NOTE: The word PASSWORD in the Password=PASSWORD('newpassword) line, is part of the command, change only the word newpassword to your new password.

6.) Test the change
mysql -u root -p
enter the new password when prompted....if it the mysql> prompt is displayed the change worked.

7.) restart the mysql services
rcmysql stop
pkill mysql
rcmysql start
mysql -u root -p
(then enter the password when prompted)
NOTE:  This last command is optional, but a good second test to confirm the password change.

Disclaimer

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.

  • Document ID:7009745
  • Creation Date: 15-Nov-2011
  • Modified Date:03-Mar-2020
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.