{"id":14763,"date":"2021-11-13T11:57:05","date_gmt":"2021-11-13T11:57:05","guid":{"rendered":"https:\/\/www.milesweb.in\/hosting-faqs\/?p=14763"},"modified":"2026-02-27T12:32:22","modified_gmt":"2026-02-27T07:02:22","slug":"restore-database-access","status":"publish","type":"post","link":"https:\/\/www.milesweb.in\/hosting-faqs\/restore-database-access\/","title":{"rendered":"How to Restore Database Access of Users?"},"content":{"rendered":"<p><strong>Summary<\/strong><br \/>\nIf a database user loses access to databases, you can use the <span style=\"color: #0000ff;\"><em>restoregrants<\/em><\/span> utility to restore the user&#8217;s database grants. The other way is to update the password.<\/p>\n<h2 id=\"the-restoregrants-script\">How to use the restoregrants script?<\/h2>\n<p>Run one of the following commands from the command line to use the <span style=\"color: #0000ff;\"><em>restoregrants<\/em><\/span> script to restore the user&#8217;s database access:<\/p>\n<pre class=\"lang:default decode:true\">\/usr\/local\/cpanel\/bin\/restoregrants --cpuser=$cpuser --db=$type --dbuser=$dbuser\r\n\/usr\/local\/cpanel\/bin\/restoregrants --cpuser=$cpuser --db=$type  --all<\/pre>\n<p><strong>Description of the variables used in the above example:<\/strong><\/p>\n<ul>\n<li><code>$cpuser<\/code>\u00a0\u2014 Refers to the cPanel username who lost their database access.<\/li>\n<li><code>$dbuser<\/code>\u00a0\u2014 The database user who can restore the database.\n<ul>\n<li>If you use the\u00a0<span style=\"color: #0000ff;\"><code>--dbuser<\/code><\/span>\u00a0flag,\u00a0<code>$dbuser<\/code>\u00a0describe the database user.<\/li>\n<li>If you use the\u00a0<span style=\"color: #0000ff;\"><code>--all<\/code><\/span>\u00a0flag, the script restores permissions for all database users associated with the cPanel account.<\/li>\n<\/ul>\n<\/li>\n<li><code>$type<\/code>\u00a0\u2014 Refers to the type of database:\n<ul>\n<li><code>mysql<\/code>\u00a0\u2014 MySQL\u00ae.<\/li>\n<li><code>pg<\/code>\u00a0\u2014 PostgreSQL\u00ae.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<h2>How to use the Update Password method?<\/h2>\n<p>The <em><span style=\"color: #0000ff;\">restoregrants<\/span><\/em> script may fail to restore database access in some conditions.<\/p>\n<p>In case the script fails, the <strong>cPanel<\/strong> user or the <strong>WHM<\/strong> user who controls the account (system administrator or the reseller) can restore grants by resetting the cPanel account&#8217;s password.<\/p>\n<p>Procedures to be followed by a cPanel user to restore grants:<\/p>\n<h3>If you are a cPanel user you can use the following steps to restore grants:<\/h3>\n<p>1] Access the <strong><em>Password and Security<\/em><\/strong> interface in cPanel\u00a0 via <em><strong>cPanel &gt;&gt; Home &gt;&gt; Preferences &gt;&gt; Password &amp; Security<\/strong><\/em>.<\/p>\n<p>2] Choose\u00a0<strong><em>Allow MySQL password change<\/em><\/strong>.<\/p>\n<p>3] In the\u00a0<strong><em>Old Password<\/em><\/strong>\u00a0text box enter the old password.<\/p>\n<p>4] Now, enter a new password in the\u00a0<strong><em>New Password<\/em><\/strong>\u00a0and\u00a0<strong><em>New Password (again)<\/em><\/strong>\u00a0text boxes.<\/p>\n<p>5] Click on\u00a0<strong><em>Change your password now<\/em><\/strong>.<\/p>\n<p>Procedures to be followed by a WHM user to restore grants:<\/p>\n<h3>If you are a Server Administrator or a Reseller\u00a0you can use the following steps to restore grants:<\/h3>\n<p>1]\u00a0\u00a0Access to WHM\u2019s\u00a0<strong><em>List Accounts<\/em><\/strong>\u00a0interface\u00a0 via\u00a0<strong><em>WHM &gt;&gt; Home &gt;&gt; Account Information &gt;&gt; List Accounts<\/em><\/strong>.<\/p>\n<p>2]\u00a0 Next to the appropriate account click the\u00a0<em><strong>+<\/strong><\/em>\u00a0link.<\/p>\n<p>3]\u00a0 Now, choose the <strong><em>Sync MySQL password with account password <\/em><\/strong>option.<\/p>\n<p>4]\u00a0 In the\u00a0<strong><em>Change Password<\/em><\/strong>\u00a0text box enter a new password.<\/p>\n<p>5]\u00a0Click on\u00a0<strong><em>Change<\/em><\/strong>.<\/p>\n<p>Congratulation you are done restoring database access of users!<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Summary If a database user loses access to databases, you can use the restoregrants utility to restore the user&#8217;s database grants. The other way is to update the password. How to use the restoregrants script? Run one of the following commands from the command line to use the restoregrants script to restore the user&#8217;s database [&hellip;]<\/p>\n","protected":false},"author":25,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3047],"tags":[2723,2725,2722,2724],"class_list":["post-14763","post","type-post","status-publish","format-standard","placeholder-for-hentry","category-databases-mysql-mariadb","tag-cpanel-database-restore","tag-reseller-database-restore","tag-restore-database-access","tag-whm-database-restore"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Restore Database Access of Users?<\/title>\n<meta name=\"description\" content=\"The knowledge base explains steps to restore database access of the users. It explains steps for cPanel users as well as system administrators and resellers\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.milesweb.in\/hosting-faqs\/restore-database-access\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Restore Database Access of Users?\" \/>\n<meta property=\"og:description\" content=\"The knowledge base explains steps to restore database access of the users. It explains steps for cPanel users as well as system administrators and resellers\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.in\/hosting-faqs\/restore-database-access\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"article:published_time\" content=\"2021-11-13T11:57:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-27T07:02:22+00:00\" \/>\n<meta name=\"author\" content=\"Prajakta Marathe\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Prajakta Marathe\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/restore-database-access\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/restore-database-access\/\"},\"author\":{\"name\":\"Prajakta Marathe\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/e46bb3e1613b47b1975e8635509d1770\"},\"headline\":\"How to Restore Database Access of Users?\",\"datePublished\":\"2021-11-13T11:57:05+00:00\",\"dateModified\":\"2026-02-27T07:02:22+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/restore-database-access\/\"},\"wordCount\":350,\"commentCount\":0,\"keywords\":[\"cPanel database restore\",\"Reseller database restore\",\"restore database access\",\"WHM database restore\"],\"articleSection\":[\"Databases (MySQL \/ MariaDB)\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/restore-database-access\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/restore-database-access\/\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/restore-database-access\/\",\"name\":\"How to Restore Database Access of Users?\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\"},\"datePublished\":\"2021-11-13T11:57:05+00:00\",\"dateModified\":\"2026-02-27T07:02:22+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/e46bb3e1613b47b1975e8635509d1770\"},\"description\":\"The knowledge base explains steps to restore database access of the users. It explains steps for cPanel users as well as system administrators and resellers\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/restore-database-access\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.in\/hosting-faqs\/restore-database-access\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/restore-database-access\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Restore Database Access of Users?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/e46bb3e1613b47b1975e8635509d1770\",\"name\":\"Prajakta Marathe\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/02\/prajakta_marathe-min-150x150.jpeg\",\"contentUrl\":\"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/02\/prajakta_marathe-min-150x150.jpeg\",\"caption\":\"Prajakta Marathe\"},\"description\":\"Prajakta is a content writer at MilesWeb. She is ardent about writing technical and non-technical blogs. Adding value to know-how is what she believes in. She also has good experience in educational field. Gratified in sharing knowledge.\",\"sameAs\":[\"https:\/\/www.milesweb.in\"],\"url\":\"https:\/\/www.milesweb.in\/hosting-faqs\/author\/prajakta-marathe\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Restore Database Access of Users?","description":"The knowledge base explains steps to restore database access of the users. It explains steps for cPanel users as well as system administrators and resellers","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:\/\/www.milesweb.in\/hosting-faqs\/restore-database-access\/","og_locale":"en_US","og_type":"article","og_title":"How to Restore Database Access of Users?","og_description":"The knowledge base explains steps to restore database access of the users. It explains steps for cPanel users as well as system administrators and resellers","og_url":"https:\/\/www.milesweb.in\/hosting-faqs\/restore-database-access\/","og_site_name":"Web Hosting FAQs by MilesWeb","article_published_time":"2021-11-13T11:57:05+00:00","article_modified_time":"2026-02-27T07:02:22+00:00","author":"Prajakta Marathe","twitter_misc":{"Written by":"Prajakta Marathe","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/restore-database-access\/#article","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/restore-database-access\/"},"author":{"name":"Prajakta Marathe","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/e46bb3e1613b47b1975e8635509d1770"},"headline":"How to Restore Database Access of Users?","datePublished":"2021-11-13T11:57:05+00:00","dateModified":"2026-02-27T07:02:22+00:00","mainEntityOfPage":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/restore-database-access\/"},"wordCount":350,"commentCount":0,"keywords":["cPanel database restore","Reseller database restore","restore database access","WHM database restore"],"articleSection":["Databases (MySQL \/ MariaDB)"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.milesweb.in\/hosting-faqs\/restore-database-access\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/restore-database-access\/","url":"https:\/\/www.milesweb.in\/hosting-faqs\/restore-database-access\/","name":"How to Restore Database Access of Users?","isPartOf":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website"},"datePublished":"2021-11-13T11:57:05+00:00","dateModified":"2026-02-27T07:02:22+00:00","author":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/e46bb3e1613b47b1975e8635509d1770"},"description":"The knowledge base explains steps to restore database access of the users. It explains steps for cPanel users as well as system administrators and resellers","breadcrumb":{"@id":"https:\/\/www.milesweb.in\/hosting-faqs\/restore-database-access\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.in\/hosting-faqs\/restore-database-access\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/restore-database-access\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.in\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"How to Restore Database Access of Users?"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.in\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.in\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/e46bb3e1613b47b1975e8635509d1770","name":"Prajakta Marathe","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.milesweb.in\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/02\/prajakta_marathe-min-150x150.jpeg","contentUrl":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-content\/uploads\/2021\/02\/prajakta_marathe-min-150x150.jpeg","caption":"Prajakta Marathe"},"description":"Prajakta is a content writer at MilesWeb. She is ardent about writing technical and non-technical blogs. Adding value to know-how is what she believes in. She also has good experience in educational field. Gratified in sharing knowledge.","sameAs":["https:\/\/www.milesweb.in"],"url":"https:\/\/www.milesweb.in\/hosting-faqs\/author\/prajakta-marathe\/"}]}},"_links":{"self":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/14763","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/users\/25"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=14763"}],"version-history":[{"count":1,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/14763\/revisions"}],"predecessor-version":[{"id":14764,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/posts\/14763\/revisions\/14764"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=14763"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=14763"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.in\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=14763"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}