{"id":1905,"date":"2023-10-30T12:30:00","date_gmt":"2023-10-30T17:30:00","guid":{"rendered":"https:\/\/linuxhostsupport.com\/blog\/?p=1905"},"modified":"2023-09-27T07:03:37","modified_gmt":"2023-09-27T12:03:37","slug":"how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04","status":"publish","type":"post","link":"https:\/\/linuxhostsupport.com\/blog\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\/","title":{"rendered":"How to Reset Your MySQL or MariaDB Root Password on Ubuntu 22.04"},"content":{"rendered":"\n<div id=\"linux-2344849664\" class=\"linux-before-1st-paragraph linux-entity-placement\" style=\"margin-top: 15px;margin-bottom: 15px;\"><a href=\"https:\/\/www.rosehosting.com\/managed-vps-hosting\/?mtm_campaign=blogs&#038;mtm_source=lhs&#038;mtm_medium=blog&#038;mtm_content=managed-vps&#038;mtm_cid=1339&#038;mtm_placement=inline\" aria-label=\"Untitled\"><img src=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2020\/12\/1340090_NVMeGoogleAds_728x90_041322.jpg\" alt=\"\"  srcset=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2020\/12\/1340090_NVMeGoogleAds_728x90_041322.jpg 728w, https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2020\/12\/1340090_NVMeGoogleAds_728x90_041322-300x37.jpg 300w\" sizes=\"(max-width: 728px) 100vw, 728px\" width=\"728\" height=\"90\"  style=\"display: inline-block;\" \/><\/a><\/div><p>In this tutorial we are going to explain how to reset MySQL or MariaDB Root password on Ubuntu 22.04.<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>MySQL is an open-source SQL database management system distributed and supported by Oracle Corporation. It is a relational database management system that provides fast, reliable, scalable, and easy usage. MySQL works in client\/server or embedded systems. <\/p>\n\n\n\n<p>MariaDB is also a popular open-source relational database management system made by the original MySQL developers. In this tutorial, we are going to install the MariaDB database system and will explain how to reset the root password. Since it is made by MySQL developers, the same commands are applied for both systems.<\/p>\n\n\n\n<p>Installing MariaDB or MySQL and resetting the root password is a straightforward process that may take up to 15 minutes. Let&#8217;s get started!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A server with Ubuntu 22.04 as OS<\/li>\n\n\n\n<li>User privileges: root or non-root user with sudo privileges<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1. Update the System<\/h2>\n\n\n\n<p>Every fresh installation of Ubuntu 22.04 needs to be updated. That&#8217;s why we need to update the package to the latest versions available. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt-get update -y &amp;&amp; sudo apt-get upgrade -y<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2. Install MariaDB database service.<\/h2>\n\n\n\n<p>To install the MariaDB database server, execute the command below. <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt install mariadb-server -y<\/pre>\n\n\n\n<p>Start and enable the mariadb.service with the following commands: <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl start mariadb &amp;&amp; sudo systemctl enable mariadb<\/code><\/pre>\n\n\n\n<p>Check the status of the mariadb.service <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo systemctl status mariadb<\/code><\/pre>\n\n\n\n<p>You should receive the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# sudo systemctl status mariadb \n\u25cf mariadb.service - MariaDB 10.6.12 database server \nLoaded: loaded (\/lib\/systemd\/system\/mariadb.service; enabled; vendor preset: enabled) \nActive: active (running) since Thu 2023-09-07 09:28:14 CDT; 17s ago \nDocs: man:mariadbd(8) https:\/\/mariadb.com\/kb\/en\/library\/systemd\/ \nMain PID: 2722 (mariadbd) \nStatus: \"Taking your SQL requests now...\" \nTasks: 16 (limit: 4558) \nMemory: 61.2M \nCPU: 528ms \nCGroup: \/system.slice\/mariadb.service \u2514\u25002722 \/usr\/sbin\/mariadbd<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3. Secure MariaDB database service<\/h2>\n\n\n\n<p>Next we will secure the MariaDB database service and will set a root password. To do that execute the following command: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql_secure_installation<\/pre>\n\n\n\n<p>You need to pass these steps with the following options: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Switch to unix_socket authentication [Y\/n] <strong>Y<\/strong> \nChange the root password? [Y\/n] <strong>Y<\/strong> \nNew password: \nRe-enter new password: \nPassword updated successfully! \nReloading privilege tables.. \n... Success! \nRemove anonymous users? [Y\/n] <strong>Y<\/strong> \nDisallow root login remotely? [Y\/n] <strong>Y<\/strong> \nRemove test database and access to it? [Y\/n] <strong>Y<\/strong> \nReload privilege tables now? [Y\/n] <strong>Y<\/strong> \nAll done! If you've completed all of the above steps, your MariaDB installation should now be secure. \nThanks for using MariaDB<\/pre>\n\n\n\n<p>After installation login to the MySQL console will not ask for a password and will let you without any password, even though we set it in the previous step.<\/p>\n\n\n\n<p>To set MySQL to ask you for a password execute the following command: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ALTER USER 'root'@'localhost' IDENTIFIED VIA mysql_native_password USING PASSWORD('YourStrongPasswordHere');<\/pre>\n\n\n\n<p>Now, if you try to log in only with this command: <strong>mysql<\/strong> you will get this message: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# mysql ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)<\/pre>\n\n\n\n<p>You need to use the following command and enter your password: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# mysql -u root -p \nEnter password: \nWelcome to the MariaDB monitor. Commands end with ; or \\g. Your MariaDB connection id is 64 Server version: 10.6.12-MariaDB-0ubuntu0.22.04.1 Ubuntu 22.04 \n\nCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. \n\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement. \nMariaDB [(none)]&gt;\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4. Reset MariaDB Root password<\/h2>\n\n\n\n<p>In the previous step we set the root password for the MariaDB root user to be <strong>YourStrongPasswordHere<\/strong>. We know our root password but in some cases, the admins or developers manage to lose it and need to log in to the MySQL server. <\/p>\n\n\n\n<p>So, to set a new root password we must follow the next steps:<\/p>\n\n\n\n<p>First stop the MariaDB service with the following command: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl stop mariadb<\/pre>\n\n\n\n<p>After stopping the service check the status: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">systemctl status mariadb<\/pre>\n\n\n\n<p>You should get the following output: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# systemctl status mariadb \n\u25cb mariadb.service - MariaDB 10.6.12 database server \nLoaded: loaded (\/lib\/systemd\/system\/mariadb.service; enabled; vendor preset: enabled) \nActive: inactive (dead) since Thu 2023-09-07 10:13:33 CDT; 36s ago \nDocs: man:mariadbd(8) https:\/\/mariadb.com\/kb\/en\/library\/systemd\/ \nProcess: 2722 ExecStart=\/usr\/sbin\/mariadbd $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=0\/SUCCESS) \nMain PID: 2722 (code=exited, status=0\/SUCCESS) \n<strong>Status: \"MariaDB server is down\"<\/strong> \nCPU: 1.760s<\/pre>\n\n\n\n<p>Now, when the service is stopped we need to start it without permission checking and without networking to prevent other users from connecting in the meantime: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo mysqld_safe --skip-grant-tables --skip-networking &amp;<\/pre>\n\n\n\n<p>The ampersand will allow us to use the terminal. Now, execute the following command: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">mysql -u root<\/pre>\n\n\n\n<p>This will connect us without a password. Flush the privileges first and then change the password with the commands below: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">FLUSH PRIVILEGES; \nSET PASSWORD FOR 'root'@'localhost' = PASSWORD('NewStrongPasswordHere'); EXIT;<\/pre>\n\n\n\n<p>Now, the password is changed from <strong>YourStrongPasswordHere<\/strong> TO <strong>NewStrongPasswordHere<\/strong>.<\/p>\n\n\n\n<p>Next we need to kill the process id manually for the mysql service. To find it execute the following command: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ps aux | grep mysqld_safe<\/pre>\n\n\n\n<p>You will get output similar to this: root@host:~# <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ps aux | grep mysqld_safe \nroot 3292 0.0 0.1 14100 5596 pts\/0 S 05:18 0:00 sudo mysqld_safe --skip-grant-tables --skip-networking \nroot 3293 0.0 0.0 14100 880 pts\/1 Ss+ 05:18 0:00 sudo mysqld_safe --skip-grant-tables --skip-networking \nroot 3294 0.0 0.0 2888 1732 pts\/1 S 05:18 0:00 \/bin\/sh \/usr\/bin\/mysqld_safe --skip-grant-tables --skip-networking \nroot 3427 0.0 0.0 9208 2288 pts\/0 S+ 05:28 0:00 grep mysqld_saf<\/pre>\n\n\n\n<p>In our case, the process id is <strong>3292<\/strong>. To kill this process execute the following command: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">kill -9 3292<\/pre>\n\n\n\n<p>Now, we can start the MariaDB service normally: <\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo systemctl start mariadb<\/pre>\n\n\n\n<p>Now, you can use the <strong>NewStrongPasswordHere<\/strong>.<\/p>\n\n\n\n<p>Congratulations! You just learned how to reset MySQL or MariaDB Root password on Ubuntu 22.04. Of course, you do not have to do this if you find any difficulties. You can contact our technical support by submitting a support ticket or live chat. We are available 24\/7<\/p>\n\n\n\n<p>If you liked this post on how to reset your MySQL or MariaDB root password on Ubuntu 22.04, please share it with your friends on the social networks or simply leave a reply below. Thanks.<\/p><div id=\"linux-3182487153\" class=\"linux-after-8th-paragraph linux-entity-placement\" style=\"margin-top: 15px;margin-bottom: 15px;\"><a href=\"https:\/\/www.rosehosting.com\/managed-vps-hosting\/?mtm_campaign=blogs&#038;mtm_source=lhs&#038;mtm_medium=blog&#038;mtm_content=managed-vps&#038;mtm_cid=1340&#038;mtm_placement=inline\" aria-label=\"Untitled\"><img src=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2020\/12\/1340095_VPSGoogleAds_728x90_042622.jpg\" alt=\"\"  srcset=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2020\/12\/1340095_VPSGoogleAds_728x90_042622.jpg 728w, https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2020\/12\/1340095_VPSGoogleAds_728x90_042622-300x37.jpg 300w\" sizes=\"(max-width: 728px) 100vw, 728px\" width=\"728\" height=\"90\"  style=\"display: inline-block;\" \/><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial we are going to explain how to reset MySQL or MariaDB Root password on Ubuntu 22.04.<\/p>\n","protected":false},"author":1,"featured_media":1947,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[260,2,182],"tags":[261,55,77,20],"class_list":["post-1905","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-databases","category-tutorials","category-ubuntu","tag-database-management","tag-mariadb","tag-mysql","tag-ubuntu"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Reset Your MySQL or MariaDB Root Password on Ubuntu 22.04 | LinuxHostSupport<\/title>\n<meta name=\"description\" content=\"Reset MySQL or MariaDB root password on Ubuntu 22.04 with our straightforward guide. Read and regain complete control of your database system.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/linuxhostsupport.com\/blog\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Reset Your MySQL or MariaDB Root Password on Ubuntu 22.04\" \/>\n<meta property=\"og:description\" content=\"Reset MySQL or MariaDB root password on Ubuntu 22.04 with our straightforward guide. Read on and regain complete control of your database system.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/linuxhostsupport.com\/blog\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\/\" \/>\n<meta property=\"og:site_name\" content=\"LinuxHostSupport\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/linuxhostsupport\" \/>\n<meta property=\"article:published_time\" content=\"2023-10-30T17:30:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2023\/09\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"742\" \/>\n\t<meta property=\"og:image:height\" content=\"576\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"How to Reset Your MySQL or MariaDB Root Password on Ubuntu 22.04\" \/>\n<meta name=\"twitter:description\" content=\"Reset MySQL or MariaDB root password on Ubuntu 22.04 with our straightforward guide. Read on and regain complete control of your database system.\" \/>\n<meta name=\"twitter:creator\" content=\"@lnxhostsupport\" \/>\n<meta name=\"twitter:site\" content=\"@lnxhostsupport\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\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\":\"Article\",\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/#\\\/schema\\\/person\\\/53a9571ea078cdf350137a1e97423cfb\"},\"headline\":\"How to Reset Your MySQL or MariaDB Root Password on Ubuntu 22.04\",\"datePublished\":\"2023-10-30T17:30:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\\\/\"},\"wordCount\":617,\"commentCount\":1,\"image\":{\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04.webp\",\"keywords\":[\"database management\",\"mariadb\",\"mysql\",\"ubuntu\"],\"articleSection\":[\"Databases\",\"Tutorials\",\"Ubuntu\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\\\/\",\"url\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\\\/\",\"name\":\"How to Reset Your MySQL or MariaDB Root Password on Ubuntu 22.04 | LinuxHostSupport\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04.webp\",\"datePublished\":\"2023-10-30T17:30:00+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/#\\\/schema\\\/person\\\/53a9571ea078cdf350137a1e97423cfb\"},\"description\":\"Reset MySQL or MariaDB root password on Ubuntu 22.04 with our straightforward guide. Read and regain complete control of your database system.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\\\/#primaryimage\",\"url\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04.webp\",\"contentUrl\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/09\\\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04.webp\",\"width\":742,\"height\":576,\"caption\":\"how to reset your mysql or mariadb root password on ubuntu 22.04\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Reset Your MySQL or MariaDB Root Password on Ubuntu 22.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/\",\"name\":\"LinuxHostSupport\",\"description\":\"Linux Tutorials and Guides\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/#\\\/schema\\\/person\\\/53a9571ea078cdf350137a1e97423cfb\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ed83c63a34114218f977e1f913be03906d17c7d9c800788fcac345f5edaf6cfa?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ed83c63a34114218f977e1f913be03906d17c7d9c800788fcac345f5edaf6cfa?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ed83c63a34114218f977e1f913be03906d17c7d9c800788fcac345f5edaf6cfa?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"url\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/author\\\/r0s3admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Reset Your MySQL or MariaDB Root Password on Ubuntu 22.04 | LinuxHostSupport","description":"Reset MySQL or MariaDB root password on Ubuntu 22.04 with our straightforward guide. Read and regain complete control of your database system.","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:\/\/linuxhostsupport.com\/blog\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\/","og_locale":"en_US","og_type":"article","og_title":"How to Reset Your MySQL or MariaDB Root Password on Ubuntu 22.04","og_description":"Reset MySQL or MariaDB root password on Ubuntu 22.04 with our straightforward guide. Read on and regain complete control of your database system.","og_url":"https:\/\/linuxhostsupport.com\/blog\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\/","og_site_name":"LinuxHostSupport","article_publisher":"https:\/\/www.facebook.com\/linuxhostsupport","article_published_time":"2023-10-30T17:30:00+00:00","og_image":[{"width":742,"height":576,"url":"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2023\/09\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04.webp","type":"image\/webp"}],"author":"admin","twitter_card":"summary_large_image","twitter_title":"How to Reset Your MySQL or MariaDB Root Password on Ubuntu 22.04","twitter_description":"Reset MySQL or MariaDB root password on Ubuntu 22.04 with our straightforward guide. Read on and regain complete control of your database system.","twitter_creator":"@lnxhostsupport","twitter_site":"@lnxhostsupport","twitter_misc":{"Written by":"admin","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\/#article","isPartOf":{"@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\/"},"author":{"name":"admin","@id":"https:\/\/linuxhostsupport.com\/blog\/#\/schema\/person\/53a9571ea078cdf350137a1e97423cfb"},"headline":"How to Reset Your MySQL or MariaDB Root Password on Ubuntu 22.04","datePublished":"2023-10-30T17:30:00+00:00","mainEntityOfPage":{"@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\/"},"wordCount":617,"commentCount":1,"image":{"@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2023\/09\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04.webp","keywords":["database management","mariadb","mysql","ubuntu"],"articleSection":["Databases","Tutorials","Ubuntu"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/linuxhostsupport.com\/blog\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\/","url":"https:\/\/linuxhostsupport.com\/blog\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\/","name":"How to Reset Your MySQL or MariaDB Root Password on Ubuntu 22.04 | LinuxHostSupport","isPartOf":{"@id":"https:\/\/linuxhostsupport.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\/#primaryimage"},"image":{"@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2023\/09\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04.webp","datePublished":"2023-10-30T17:30:00+00:00","author":{"@id":"https:\/\/linuxhostsupport.com\/blog\/#\/schema\/person\/53a9571ea078cdf350137a1e97423cfb"},"description":"Reset MySQL or MariaDB root password on Ubuntu 22.04 with our straightforward guide. Read and regain complete control of your database system.","breadcrumb":{"@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/linuxhostsupport.com\/blog\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\/#primaryimage","url":"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2023\/09\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04.webp","contentUrl":"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2023\/09\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04.webp","width":742,"height":576,"caption":"how to reset your mysql or mariadb root password on ubuntu 22.04"},{"@type":"BreadcrumbList","@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-reset-your-mysql-or-mariadb-root-password-on-ubuntu-22-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/linuxhostsupport.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Reset Your MySQL or MariaDB Root Password on Ubuntu 22.04"}]},{"@type":"WebSite","@id":"https:\/\/linuxhostsupport.com\/blog\/#website","url":"https:\/\/linuxhostsupport.com\/blog\/","name":"LinuxHostSupport","description":"Linux Tutorials and Guides","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/linuxhostsupport.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/linuxhostsupport.com\/blog\/#\/schema\/person\/53a9571ea078cdf350137a1e97423cfb","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ed83c63a34114218f977e1f913be03906d17c7d9c800788fcac345f5edaf6cfa?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ed83c63a34114218f977e1f913be03906d17c7d9c800788fcac345f5edaf6cfa?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ed83c63a34114218f977e1f913be03906d17c7d9c800788fcac345f5edaf6cfa?s=96&d=mm&r=g","caption":"admin"},"url":"https:\/\/linuxhostsupport.com\/blog\/author\/r0s3admin\/"}]}},"_links":{"self":[{"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/posts\/1905","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/comments?post=1905"}],"version-history":[{"count":26,"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/posts\/1905\/revisions"}],"predecessor-version":[{"id":1944,"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/posts\/1905\/revisions\/1944"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/media\/1947"}],"wp:attachment":[{"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/media?parent=1905"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/categories?post=1905"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/tags?post=1905"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}