{"id":61109,"date":"2021-05-13T13:00:00","date_gmt":"2021-05-13T18:00:00","guid":{"rendered":"https:\/\/blog.cpanel.com\/?p=61109"},"modified":"2021-05-13T13:00:00","modified_gmt":"2021-05-13T18:00:00","slug":"how-to-reset-the-mysql-root-password-and-mysql-user-passwords","status":"publish","type":"post","link":"https:\/\/devel.www.cpanel.net\/blog\/products\/how-to-reset-the-mysql-root-password-and-mysql-user-passwords\/","title":{"rendered":"How To Reset the MySQL\u00ae Root Password And MySQL User Passwords"},"content":{"rendered":"\n

MySQL is the primary database software for sites hosted on cPanel-managed servers, including WordPress\u00ae<\/sup> and ecommerce applications such as Magento. Because MySQL has to manage read and write permissions for many different sites and databases, it is a multi-user system. <\/p>\n\n\n\n

Each user account has a set of permissions that limit its access. The MySQL root user has no limits; as the database server\u2019s administrator, the root user can create and delete accounts and modify any other account or database. <\/p>\n\n\n\n

If the MySQL root user\u2019s password is exposed to third parties or non-admin server users, it should be changed. A bad actor who gets hold of the password may abuse it to disrupt sites and access sensitive information. <\/p>\n\n\n\n

In this article, we explain how to change the MySQL root password with cPanel & WHM. We\u2019ll also explore changing other MySQL user account passwords and show you a shortcut for quickly changing WordPress database passwords in WP Toolkit<\/em>. <\/p>\n\n\n\n

Reset the MySQL Root Password with cPanel & WHM<\/strong><\/h2>\n\n\n\n

Before we get to changing passwords, let\u2019s clear up a common misunderstanding: The MySQL root user is not the server\u2019s root user. Your server\u2019s Linux operating system has multiple users and a root account, and so does the MySQL database software. But Linux and MySQL users are unconnected; different systems manage them.<\/p>\n\n\n\n

This article focuses on the MySQL root account. If you want to change your cPanel server\u2019s root account password, read the Change Root Password<\/a> documentation instead. <\/p>\n\n\n\n

To change the MySQL root password, open WHM and navigate to MySQL Root Password <\/em>under SQL Services <\/em>in the sidebar menu. <\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

Enter a new password in the Password <\/em>and Password[again] <\/em>fields. The password should be long, complex, and hard to guess. A weak password may be compromised in a brute force or dictionary attack, creating a critical security vulnerability.  <\/p>\n\n\n\n

The page includes a password strength test, and you should choose a password it considers Very Strong. <\/em>We also integrate a Password Generator<\/em> programmed with default options to create a secure and hard-to-guess password.<\/p>\n\n\n\n

If you expect to connect remotely to the MySQL server with the root account, take note of the password. It will not be displayed again. However, you can retrieve the MySQL root password from a file stored on your server.  Log in with SSH<\/a> as the root user and run the following command:<\/p>\n\n\n\n

cat \/root\/.my.cnf<\/code><\/pre>\n\n\n\n

This displays a file that includes the MySQL root password. You should not edit this file; doing so won\u2019t change the password, but it will prevent cPanel from accessing the root account and managing the MySQL server. <\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

We strongly advise that you change the MySQL root password in WHM and not by interacting with the MySQL service directly. While it is possible to change the root password from the command line, you would also need to configure other parts of the system to use the new password. When you use WHM, it takes care of that configuration for you. <\/p>\n\n\n\n

Reset MySQL User Account Passwords <\/strong><\/h2>\n\n\n\n

Changing the password for other MySQL users is also straightforward. The server administrator can edit any MySQL user\u2019s account in WHM. cPanel users can edit passwords for databases their account manages. <\/p>\n\n\n\n

Changing MySQL User Account Passwords in WHM<\/strong><\/h3>\n\n\n\n

Open WHM and select Change MySQL User Password <\/em>under SQL Services <\/em>in the sidebar menu. <\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

Choose the MySQL user you\u2019d like to edit from the dropdown menu. Enter and confirm the new password. As with the root password interface, Change MySQL User Password <\/em>includes a password strength meter and a password generator. <\/p>\n\n\n\n

Changing MySQL User Account Passwords in cPanel<\/strong><\/h3>\n\n\n\n

Log in to your cPanel account and select MySQL Remote Databases <\/em>from the Databases<\/em> section of the main page menu. <\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

This tool adds new MySQL users and modifies databases, but we\u2019re interested in the Current Users <\/em>section at the bottom of the page. Here you will see a list of database users and, in the Actions <\/em>column, a Change Password <\/em>option.<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

The interface here is similar to cPanel\u2019s other password editing tools, with the familiar strength indicator and password generator. <\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

Changing WordPress MySQL Database Passwords in cPanel<\/strong><\/h2>\n\n\n\n

If you look at the images in the last section, you\u2019ll see that many database users have a \u201cwp\u201d prefix. These are users cPanel created for WordPress-specific databases. WordPress hosts are often asked to change MySQL passwords when hosting clients lose them. <\/p>\n\n\n\n

You can change WordPress user database passwords as we described in the previous section. But if you do it that way, you also have to reconfigure WordPress to use the new password. There is a quick and easy way to accomplish both tasks simultaneously in the cPanel WP Toolkit<\/a> (WTK). <\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n
  1. Open WTK and find the site you want to edit. <\/li>
  2. Expand the detail view and select the Database <\/em>tab. <\/li>
  3. Click the Change <\/em>link <\/em>next to Database user name. <\/em><\/li><\/ol>\n\n\n\n

    In the pop-up that appears, you can edit both the database username and password. WTK configures the database and the site, making WordPress database password edits a simple one-step process. <\/p>\n\n\n\n

    Streamlined MySQL Database Management with cPanel & WHM<\/strong><\/h2>\n\n\n\n

    We\u2019ve focused on just one aspect of MySQL management in this article, but cPanel & WHM is a complete database management solution. It includes easy-to-use interfaces that automate the most common tasks and powerful database editing tools like phpMyAdmin for manipulating any aspect of your server\u2019s databases. As always, if you have any feedback or comments, please let us know. We are here to help in the best ways we can. You\u2019ll find us on Discord<\/a>, the cPanel forums<\/a>, and Reddit<\/a>. Be sure to also follow us on Facebook<\/a>, Instagram<\/a>, and Twitter<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"

    MySQL is the primary database software for sites hosted on cPanel-managed servers, including WordPress\u00ae and ecommerce applications such as Magento. Because MySQL has to manage read and write permissions for many different sites and databases, it is a multi-user system.  Each user account has a set of permissions that limit its access. The MySQL root […]<\/p>\n","protected":false},"author":77,"featured_media":65777,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[49],"tags":[],"class_list":["post-61109","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-products"],"acf":[],"yoast_head":"\nHow To Reset the MySQL\u00ae Root Password And MySQL User Passwords | cPanel<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=_-1268.html \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How To Reset the MySQL\u00ae Root Password And MySQL User Passwords | cPanel\" \/>\n<meta property=\"og:description\" content=\"MySQL is the primary database software for sites hosted on cPanel-managed servers, including WordPress\u00ae and ecommerce applications such as Magento. Because MySQL has to manage read and write permissions for many different sites and databases, it is a multi-user system.  Each user account has a set of permissions that limit its access. The MySQL root […]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/devel.www.cpanel.net\/blog\/products\/how-to-reset-the-mysql-root-password-and-mysql-user-passwords\/\" \/>\n<meta property=\"og:site_name\" content=\"cPanel\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/cpanel\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-05-13T18:00:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/devel.www.cpanel.net\/wp-content\/uploads\/2021\/05\/Reset-MySQL-Passwords.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"475\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"cPanel Community\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@cPanel\" \/>\n<meta name=\"twitter:site\" content=\"@cPanel\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"cPanel Community\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/devel.www.cpanel.net\/blog\/products\/how-to-reset-the-mysql-root-password-and-mysql-user-passwords\/\",\"url\":\"https:\/\/devel.www.cpanel.net\/blog\/products\/how-to-reset-the-mysql-root-password-and-mysql-user-passwords\/\",\"name\":\"How To Reset the MySQL\u00ae Root Password And MySQL User Passwords | cPanel\",\"isPartOf\":{\"@id\":\"https:\/\/devel.www.cpanel.net\/#website\"},\"datePublished\":\"2021-05-13T18:00:00+00:00\",\"dateModified\":\"2021-05-13T18:00:00+00:00\",\"author\":{\"@id\":\"https:\/\/devel.www.cpanel.net\/#\/schema\/person\/8cf97408aad4fb70cf55d11a1d4f57f8\"},\"breadcrumb\":{\"@id\":\"https:\/\/devel.www.cpanel.net\/blog\/products\/how-to-reset-the-mysql-root-password-and-mysql-user-passwords\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/devel.www.cpanel.net\/blog\/products\/how-to-reset-the-mysql-root-password-and-mysql-user-passwords\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/devel.www.cpanel.net\/blog\/products\/how-to-reset-the-mysql-root-password-and-mysql-user-passwords\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/devel.www.cpanel.net\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How To Reset the MySQL\u00ae Root Password And MySQL User Passwords\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/devel.www.cpanel.net\/#website\",\"url\":\"https:\/\/devel.www.cpanel.net\/\",\"name\":\"cPanel\",\"description\":\"Hosting Platform of Choices\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/devel.www.cpanel.net\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/devel.www.cpanel.net\/#\/schema\/person\/8cf97408aad4fb70cf55d11a1d4f57f8\",\"name\":\"cPanel Community\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/devel.www.cpanel.net\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/e1949945083b5526bb95711bd3d616b3?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/e1949945083b5526bb95711bd3d616b3?s=96&d=mm&r=g\",\"caption\":\"cPanel Community\"},\"description\":\"The web hosting industry's most reliable management solution since 1997. With our first-class support and rich feature set, it's easy to see why our customers and partners make cPanel & WHM their hosting platform of choice. For more information, visit cPanel.net.\",\"sameAs\":[\"https:\/\/cpanel.net\"],\"url\":\"https:\/\/devel.www.cpanel.net\/blog\/author\/cpadmin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How To Reset the MySQL\u00ae Root Password And MySQL User Passwords | cPanel","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/devel.www.cpanel.net\/blog\/products\/how-to-reset-the-mysql-root-password-and-mysql-user-passwords\/","og_locale":"en_US","og_type":"article","og_title":"How To Reset the MySQL\u00ae Root Password And MySQL User Passwords | cPanel","og_description":"MySQL is the primary database software for sites hosted on cPanel-managed servers, including WordPress\u00ae and ecommerce applications such as Magento. Because MySQL has to manage read and write permissions for many different sites and databases, it is a multi-user system.  Each user account has a set of permissions that limit its access. The MySQL root […]","og_url":"https:\/\/devel.www.cpanel.net\/blog\/products\/how-to-reset-the-mysql-root-password-and-mysql-user-passwords\/","og_site_name":"cPanel","article_publisher":"https:\/\/www.facebook.com\/cpanel\/","article_published_time":"2021-05-13T18:00:00+00:00","og_image":[{"width":1200,"height":475,"url":"https:\/\/devel.www.cpanel.net\/wp-content\/uploads\/2021\/05\/Reset-MySQL-Passwords.png","type":"image\/png"}],"author":"cPanel Community","twitter_card":"summary_large_image","twitter_creator":"@cPanel","twitter_site":"@cPanel","twitter_misc":{"Written by":"cPanel Community","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/devel.www.cpanel.net\/blog\/products\/how-to-reset-the-mysql-root-password-and-mysql-user-passwords\/","url":"https:\/\/devel.www.cpanel.net\/blog\/products\/how-to-reset-the-mysql-root-password-and-mysql-user-passwords\/","name":"How To Reset the MySQL\u00ae Root Password And MySQL User Passwords | cPanel","isPartOf":{"@id":"https:\/\/devel.www.cpanel.net\/#website"},"datePublished":"2021-05-13T18:00:00+00:00","dateModified":"2021-05-13T18:00:00+00:00","author":{"@id":"https:\/\/devel.www.cpanel.net\/#\/schema\/person\/8cf97408aad4fb70cf55d11a1d4f57f8"},"breadcrumb":{"@id":"https:\/\/devel.www.cpanel.net\/blog\/products\/how-to-reset-the-mysql-root-password-and-mysql-user-passwords\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/devel.www.cpanel.net\/blog\/products\/how-to-reset-the-mysql-root-password-and-mysql-user-passwords\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/devel.www.cpanel.net\/blog\/products\/how-to-reset-the-mysql-root-password-and-mysql-user-passwords\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/devel.www.cpanel.net\/"},{"@type":"ListItem","position":2,"name":"How To Reset the MySQL\u00ae Root Password And MySQL User Passwords"}]},{"@type":"WebSite","@id":"https:\/\/devel.www.cpanel.net\/#website","url":"https:\/\/devel.www.cpanel.net\/","name":"cPanel","description":"Hosting Platform of Choices","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/devel.www.cpanel.net\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/devel.www.cpanel.net\/#\/schema\/person\/8cf97408aad4fb70cf55d11a1d4f57f8","name":"cPanel Community","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/devel.www.cpanel.net\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/e1949945083b5526bb95711bd3d616b3?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/e1949945083b5526bb95711bd3d616b3?s=96&d=mm&r=g","caption":"cPanel Community"},"description":"The web hosting industry's most reliable management solution since 1997. With our first-class support and rich feature set, it's easy to see why our customers and partners make cPanel & WHM their hosting platform of choice. For more information, visit cPanel.net.","sameAs":["https:\/\/cpanel.net"],"url":"https:\/\/devel.www.cpanel.net\/blog\/author\/cpadmin\/"}]}},"_links":{"self":[{"href":"https:\/\/devel.www.cpanel.net\/wp-json\/wp\/v2\/posts\/61109"}],"collection":[{"href":"https:\/\/devel.www.cpanel.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devel.www.cpanel.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devel.www.cpanel.net\/wp-json\/wp\/v2\/users\/77"}],"replies":[{"embeddable":true,"href":"https:\/\/devel.www.cpanel.net\/wp-json\/wp\/v2\/comments?post=61109"}],"version-history":[{"count":0,"href":"https:\/\/devel.www.cpanel.net\/wp-json\/wp\/v2\/posts\/61109\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devel.www.cpanel.net\/wp-json\/wp\/v2\/media\/65777"}],"wp:attachment":[{"href":"https:\/\/devel.www.cpanel.net\/wp-json\/wp\/v2\/media?parent=61109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devel.www.cpanel.net\/wp-json\/wp\/v2\/categories?post=61109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devel.www.cpanel.net\/wp-json\/wp\/v2\/tags?post=61109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}