{"id":3173,"date":"2025-08-30T09:12:09","date_gmt":"2025-08-30T09:12:09","guid":{"rendered":"https:\/\/www.devopssupport.in\/blog\/?p=3173"},"modified":"2025-08-30T09:12:15","modified_gmt":"2025-08-30T09:12:15","slug":"how-to-reset-mysql-password-on-xampp","status":"publish","type":"post","link":"https:\/\/www.devopssupport.in\/blog\/how-to-reset-mysql-password-on-xampp\/","title":{"rendered":"How to Reset MySQL Password on XAMPP"},"content":{"rendered":"\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2025\/08\/generated-image-1024x683.png\" alt=\"\" class=\"wp-image-3174\" srcset=\"https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2025\/08\/generated-image-1024x683.png 1024w, https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2025\/08\/generated-image-300x200.png 300w, https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2025\/08\/generated-image-768x512.png 768w, https:\/\/www.devopssupport.in\/blog\/wp-content\/uploads\/2025\/08\/generated-image.png 1536w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>If you\u2019ve forgotten your MySQL root password on XAMPP, don\u2019t worry \u2014 it can easily be reset. Here&#8217;s a step-by-step guide to help you reset the password and regain access to your MySQL server.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step 1: Stop the MySQL Service<\/h4>\n\n\n\n<p>First, you need to stop the MySQL service. This will prevent any conflicts while resetting the password.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open <strong>XAMPP Control Panel<\/strong>.<\/li>\n\n\n\n<li>Click on the <strong>Stop<\/strong> button next to MySQL.<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\">Step 2: Start MySQL in Safe Mode<\/h4>\n\n\n\n<p>Next, we\u2019ll run MySQL without loading the privilege tables, allowing us to reset the password.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open a command prompt or terminal window and navigate to the XAMPP directory. This is typically located at <code>C:\\xampp<\/code> (for Windows users).<\/li>\n\n\n\n<li>Navigate to the MySQL folder within XAMPP:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>cd C:\\xampp\\mysql\\bin\n<\/code><\/pre>\n\n\n\n<p>Run the following command to start MySQL in safe mode:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mysqld --skip-grant-tables\n<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\">\n<li>This command starts MySQL without loading the authentication system, which allows you to change the password without entering the current one.<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\">Step 3: Log in to MySQL<\/h4>\n\n\n\n<p>Now that MySQL is running in safe mode, you can log in without a password.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open another command prompt or terminal window.<\/li>\n\n\n\n<li>Log into MySQL with the following command:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -u root\n<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\">\n<li>You should now be logged into the MySQL prompt.<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\">Step 4: Reset the Password<\/h4>\n\n\n\n<p>Once you\u2019re logged into MySQL, follow these steps to reset the root password:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Select the <strong>mysql<\/strong> database:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>use mysql;\n<\/code><\/pre>\n\n\n\n<p>Update the root user\u2019s password using this query. Replace <code>newpassword<\/code> with the password you want to set:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>UPDATE user SET password=PASSWORD('newpassword') WHERE user='root';\n<\/code><\/pre>\n\n\n\n<p><strong>Note<\/strong>: If you&#8217;re using MySQL 5.7 or newer, the query to change the password may look like this instead:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>ALTER USER 'root'@'localhost' IDENTIFIED BY 'newpassword';\n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">tep 5: Restart MySQL<\/h4>\n\n\n\n<p>Now that the password has been reset, exit MySQL and restart the MySQL service in XAMPP:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Exit MySQL:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>exit;\n<\/code><\/pre>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Go back to the XAMPP Control Panel.<\/li>\n\n\n\n<li>Start MySQL again by clicking <strong>Start<\/strong> next to MySQL.<\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\">Step 6: Log in with the New Password<\/h4>\n\n\n\n<p>Now that MySQL is running with the new root password, you can log in as usual.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open a command prompt or terminal.<\/li>\n\n\n\n<li>Log in using the new password:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>mysql -u root -p\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>If you\u2019ve forgotten your MySQL root password on XAMPP, don\u2019t worry \u2014 it can easily be reset. Here&#8217;s a step-by-step guide to help you reset the password&#8230; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[2757,681,2752,2756,2764,2748,2765,2754,1640,2762,2755,2761,70,991,2750,100,2759,2758,2749,2746,738,2760,2747,2751,2763,2753,682,60,406],"class_list":["post-3173","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-127-0-0-1","tag-access-denied","tag-allownopassword","tag-alter-user","tag-blowfish_secret","tag-config-inc-php","tag-cookie-authentication","tag-database-login-error","tag-developer-tips","tag-error-1045","tag-flush-privileges","tag-local-server","tag-localhost","tag-mariadb","tag-my-ini","tag-mysql","tag-mysql-authentication","tag-mysql-port","tag-mysqladmin","tag-mysqli_real_connect","tag-phpmyadmin","tag-phpmyadmin-configuration","tag-phpmyadmin-login","tag-reset-root-password","tag-root-user","tag-skip-grant-tables","tag-troubleshooting","tag-xampp","tag-xampp-control-panel"],"_links":{"self":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts\/3173","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/comments?post=3173"}],"version-history":[{"count":1,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts\/3173\/revisions"}],"predecessor-version":[{"id":3175,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/posts\/3173\/revisions\/3175"}],"wp:attachment":[{"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/media?parent=3173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/categories?post=3173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopssupport.in\/blog\/wp-json\/wp\/v2\/tags?post=3173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}