{"id":6616,"date":"2021-04-23T09:46:37","date_gmt":"2021-04-23T09:46:37","guid":{"rendered":"https:\/\/www.bodhost.com\/kb\/?p=6616"},"modified":"2026-02-26T14:03:09","modified_gmt":"2026-02-26T14:03:09","slug":"what-is-the-procedure-of-restoring-mysql-user-grants","status":"publish","type":"post","link":"https:\/\/www.bodhost.com\/kb\/what-is-the-procedure-of-restoring-mysql-user-grants\/","title":{"rendered":"What is the procedure of restoring MySQL user grants."},"content":{"rendered":"\r\n<p>In this article, you will find the procedure of restoring MySQL grants.<\/p>\r\n\r\n\r\n\r\n<p>The \/usr\/local\/cpanel\/bin\/restoregrants script restores database users grants from the data in the \/var\/cpanel\/databases\/grants_* files.<\/p>\r\n\r\n\r\n\r\n<p>One can restore the grants using the following command:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-verse\">\/usr\/local\/cpanel\/bin\/restoregrants [--cpuser=cpuser] [--db=mysql|pg] [--dbuser=dbuser|--all]<\/pre>\r\n\r\n\r\n\r\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"837\" height=\"261\" class=\"wp-image-6618\" src=\"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/03\/Capture.png\" alt=\"\" srcset=\"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/03\/Capture.png 837w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/03\/Capture-300x94.png 300w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/03\/Capture-768x239.png 768w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/03\/Capture-830x259.png 830w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/03\/Capture-230x72.png 230w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/03\/Capture-350x109.png 350w, https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/03\/Capture-480x150.png 480w\" sizes=\"auto, (max-width: 837px) 100vw, 837px\" \/><\/figure>\r\n\r\n\r\n\r\n<p>The above-discussed method is the basic and easiest way for restoring your MySQL user grants using the command line interface. For more details, you can visit <a href=\"https:\/\/www.bodhost.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">bodHOST <\/a>today.<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>In this article, you will find the procedure of restoring MySQL grants. The \/usr\/local\/cpanel\/bin\/restoregrants script restores database users grants from the data in the \/var\/cpanel\/databases\/grants_* files. One can restore the&hellip;<\/p>\n<p><a href=\"https:\/\/www.bodhost.com\/kb\/what-is-the-procedure-of-restoring-mysql-user-grants\/\" class=\"more-link\">Read More<\/a><\/p>\n","protected":false},"author":21,"featured_media":7094,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[857],"tags":[906,206,907,905],"class_list":["post-6616","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sql","tag-how-to-restore-mysql-user-grants","tag-mysql","tag-mysql-show-grants-for-all-users","tag-mysql-user-grants"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What is the procedure of restoring MySQL user grants | bodHOST<\/title>\n<meta name=\"description\" content=\"This article explains the basic and easiest way of restoring MySQL grants using the command and also describes the variables in it.\" \/>\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.bodhost.com\/kb\/what-is-the-procedure-of-restoring-mysql-user-grants\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is the procedure of restoring MySQL user grants | bodHOST\" \/>\n<meta property=\"og:description\" content=\"This article explains the basic and easiest way of restoring MySQL grants using the command and also describes the variables in it.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.bodhost.com\/kb\/what-is-the-procedure-of-restoring-mysql-user-grants\/\" \/>\n<meta property=\"og:site_name\" content=\"Knowledge Base - bodHOST\" \/>\n<meta property=\"article:published_time\" content=\"2021-04-23T09:46:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-26T14:03:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/03\/Untitled-design-10.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Serena\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Serena\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/what-is-the-procedure-of-restoring-mysql-user-grants\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/what-is-the-procedure-of-restoring-mysql-user-grants\\\/\"},\"author\":{\"name\":\"Serena\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/ffd3f118493c99471ae5bd4790a55830\"},\"headline\":\"What is the procedure of restoring MySQL user grants.\",\"datePublished\":\"2021-04-23T09:46:37+00:00\",\"dateModified\":\"2026-02-26T14:03:09+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/what-is-the-procedure-of-restoring-mysql-user-grants\\\/\"},\"wordCount\":79,\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/what-is-the-procedure-of-restoring-mysql-user-grants\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/Untitled-design-9.png\",\"keywords\":[\"how to restore MySQL user grants\",\"MySQL\",\"MySQL show grants for all users\",\"MySQL user grants.\"],\"articleSection\":[\"SQL\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/what-is-the-procedure-of-restoring-mysql-user-grants\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/what-is-the-procedure-of-restoring-mysql-user-grants\\\/\",\"name\":\"What is the procedure of restoring MySQL user grants | bodHOST\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/what-is-the-procedure-of-restoring-mysql-user-grants\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/what-is-the-procedure-of-restoring-mysql-user-grants\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/Untitled-design-9.png\",\"datePublished\":\"2021-04-23T09:46:37+00:00\",\"dateModified\":\"2026-02-26T14:03:09+00:00\",\"description\":\"This article explains the basic and easiest way of restoring MySQL grants using the command and also describes the variables in it.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/what-is-the-procedure-of-restoring-mysql-user-grants\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/what-is-the-procedure-of-restoring-mysql-user-grants\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/what-is-the-procedure-of-restoring-mysql-user-grants\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/Untitled-design-9.png\",\"contentUrl\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2021\\\/03\\\/Untitled-design-9.png\",\"width\":1200,\"height\":628,\"caption\":\"MySQL user grants\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/what-is-the-procedure-of-restoring-mysql-user-grants\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"SQL\",\"item\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/category\\\/sql\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What is the procedure of restoring MySQL user grants.\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"alternateName\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"contentUrl\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"width\":240,\"height\":240,\"caption\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/ffd3f118493c99471ae5bd4790a55830\",\"name\":\"Serena\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8bf3c9f6220a13a4d46295ad7c38a0c9e351ca3a57d0e417580c8e8b83a12a50?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8bf3c9f6220a13a4d46295ad7c38a0c9e351ca3a57d0e417580c8e8b83a12a50?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/8bf3c9f6220a13a4d46295ad7c38a0c9e351ca3a57d0e417580c8e8b83a12a50?s=96&d=mm&r=g\",\"caption\":\"Serena\"},\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/author\\\/seema\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is the procedure of restoring MySQL user grants | bodHOST","description":"This article explains the basic and easiest way of restoring MySQL grants using the command and also describes the variables in it.","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.bodhost.com\/kb\/what-is-the-procedure-of-restoring-mysql-user-grants\/","og_locale":"en_US","og_type":"article","og_title":"What is the procedure of restoring MySQL user grants | bodHOST","og_description":"This article explains the basic and easiest way of restoring MySQL grants using the command and also describes the variables in it.","og_url":"https:\/\/www.bodhost.com\/kb\/what-is-the-procedure-of-restoring-mysql-user-grants\/","og_site_name":"Knowledge Base - bodHOST","article_published_time":"2021-04-23T09:46:37+00:00","article_modified_time":"2026-02-26T14:03:09+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/03\/Untitled-design-10.png","type":"image\/png"}],"author":"Serena","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Serena","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.bodhost.com\/kb\/what-is-the-procedure-of-restoring-mysql-user-grants\/#article","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/what-is-the-procedure-of-restoring-mysql-user-grants\/"},"author":{"name":"Serena","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/ffd3f118493c99471ae5bd4790a55830"},"headline":"What is the procedure of restoring MySQL user grants.","datePublished":"2021-04-23T09:46:37+00:00","dateModified":"2026-02-26T14:03:09+00:00","mainEntityOfPage":{"@id":"https:\/\/www.bodhost.com\/kb\/what-is-the-procedure-of-restoring-mysql-user-grants\/"},"wordCount":79,"publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"image":{"@id":"https:\/\/www.bodhost.com\/kb\/what-is-the-procedure-of-restoring-mysql-user-grants\/#primaryimage"},"thumbnailUrl":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/03\/Untitled-design-9.png","keywords":["how to restore MySQL user grants","MySQL","MySQL show grants for all users","MySQL user grants."],"articleSection":["SQL"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.bodhost.com\/kb\/what-is-the-procedure-of-restoring-mysql-user-grants\/","url":"https:\/\/www.bodhost.com\/kb\/what-is-the-procedure-of-restoring-mysql-user-grants\/","name":"What is the procedure of restoring MySQL user grants | bodHOST","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.bodhost.com\/kb\/what-is-the-procedure-of-restoring-mysql-user-grants\/#primaryimage"},"image":{"@id":"https:\/\/www.bodhost.com\/kb\/what-is-the-procedure-of-restoring-mysql-user-grants\/#primaryimage"},"thumbnailUrl":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/03\/Untitled-design-9.png","datePublished":"2021-04-23T09:46:37+00:00","dateModified":"2026-02-26T14:03:09+00:00","description":"This article explains the basic and easiest way of restoring MySQL grants using the command and also describes the variables in it.","breadcrumb":{"@id":"https:\/\/www.bodhost.com\/kb\/what-is-the-procedure-of-restoring-mysql-user-grants\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.bodhost.com\/kb\/what-is-the-procedure-of-restoring-mysql-user-grants\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bodhost.com\/kb\/what-is-the-procedure-of-restoring-mysql-user-grants\/#primaryimage","url":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/03\/Untitled-design-9.png","contentUrl":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2021\/03\/Untitled-design-9.png","width":1200,"height":628,"caption":"MySQL user grants"},{"@type":"BreadcrumbList","@id":"https:\/\/www.bodhost.com\/kb\/what-is-the-procedure-of-restoring-mysql-user-grants\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"SQL","item":"https:\/\/www.bodhost.com\/kb\/category\/sql\/"},{"@type":"ListItem","position":2,"name":"What is the procedure of restoring MySQL user grants."}]},{"@type":"WebSite","@id":"https:\/\/www.bodhost.com\/kb\/#website","url":"https:\/\/www.bodhost.com\/kb\/","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","description":"","publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"alternateName":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.bodhost.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.bodhost.com\/kb\/#organization","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","url":"https:\/\/www.bodhost.com\/kb\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/","url":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","contentUrl":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","width":240,"height":240,"caption":"Web Hosting Knowledge Base | bodHOST Hosting FAQ"},"image":{"@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/ffd3f118493c99471ae5bd4790a55830","name":"Serena","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/8bf3c9f6220a13a4d46295ad7c38a0c9e351ca3a57d0e417580c8e8b83a12a50?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/8bf3c9f6220a13a4d46295ad7c38a0c9e351ca3a57d0e417580c8e8b83a12a50?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/8bf3c9f6220a13a4d46295ad7c38a0c9e351ca3a57d0e417580c8e8b83a12a50?s=96&d=mm&r=g","caption":"Serena"},"url":"https:\/\/www.bodhost.com\/kb\/author\/seema\/"}]}},"_links":{"self":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/6616","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/comments?post=6616"}],"version-history":[{"count":17,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/6616\/revisions"}],"predecessor-version":[{"id":11983,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/6616\/revisions\/11983"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/media\/7094"}],"wp:attachment":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/media?parent=6616"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/categories?post=6616"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/tags?post=6616"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}