copyright | lastupdated | keywords | subcollection | ||
---|---|---|---|---|---|
|
2017-11-10 |
mysql password |
database-tools |
{{site.data.keyword.attribute-definition-list}}
{: #dbt-change-mysql-password}
To change the {{site.data.keyword.mysql}} root password, use the following steps:
-
Run the following commands:
# /etc/init.d/mysqld stop
{: pre}
# mysqld_safe --skip-grant-tables --skip-networking
{: pre}
-
Connect to {{site.data.keyword.mysql}} with the following command:
# mysql -u root
{: pre}
-
Run the following command in the {{site.data.keyword.mysql}} client:
# UPDATE mysql.user SET Password=PASSWORD('newpassword') WHERE User='root';
{: pre}
-
Replace
newpassword
with your new root password. -
Restart the {{site.data.keyword.mysql}} server by using the following command:
# /etc/init.d/mysqld start
{: pre}