Skip to content

Instantly share code, notes, and snippets.

@susanBuck
Last active October 20, 2025 06:38
Show Gist options
  • Select an option

  • Save susanBuck/39d1a384779f3d596afb19fcad6b598c to your computer and use it in GitHub Desktop.

Select an option

Save susanBuck/39d1a384779f3d596afb19fcad6b598c to your computer and use it in GitHub Desktop.
How to reset `root` password in XAMPP MySQL

Open C:\xampp\mysql\bin\my.ini (MySQL config file)

Find the line [mysqld] and right below it add skip-grant-tables. Example:

# The MySQL server
[mysqld]
skip-grant-tables
port= 3306
socket = "C:/xampp/mysql/mysql.sock"
basedir = "C:/xampp/mysql" 
tmpdir = "C:/xampp/tmp" 
[...etc...]

This should allow you to access MySQL if you don't know your password.

Stop and start MySQL from XAMPP to make this change take effect.

Next, in command line, connect to MySQL:

C:\xampp\mysql\bin\mysql.exe --user=root

Once in MySQL command line "select" the mysql database:

USE mysql;

Then, the following command will list all your MySQL users:

SELECT * FROM user \G;

You can scan through the rows to see what the root user's password is set to. There will be a few root users listed, with different hosts.

To set all root user's to have a blank password, run this command:

UPDATE user SET password = '' WHERE user = 'root';

When you're done, run exit; to exit the MySQL command line.

Next, re-enable password checking by removing skip-grant-tables from C:\xampp\mysql\bin\my.ini.

Save changes, restart MySQL from XAMPP.

Test it

Finally, test you can connect to the database using username root and password '' (blank) via one of the following methods:

  1. Attempting to access phpMyAdmin (http://localhost/phpmyadmin)
  2. Run the debug route I provided from within one of your Laravel apps
@TomasVotruba

Copy link
Copy Markdown

Thank you so much! I use Linux but one of my clients is using Windows.
We got stuck with MariaDB on root password error and tried 10 other tutorials. Failed.
After 1 hour, this finally worked!

Great job!

@wchasroth

Copy link
Copy Markdown

TYPO ALERT! Your diagram shows "skip-grant-tables" under [mysql], but your text says put it under [mysqld]. The latter is correct, the diagram/screen-shot is wrong.

@susanBuck

Copy link
Copy Markdown
Author

Removed the screenshot that had the typo.

@sl5net

sl5net commented Mar 29, 2019 •

Copy link
Copy Markdown

of some reasons. mysql server is just 3 seconds on, after i have addet skip-grant-tables behind [mysqld]

@wagaana

wagaana commented May 10, 2019

Copy link
Copy Markdown

Thanks, a lot I had messed almost everything.

@praful-dhabekar

Copy link
Copy Markdown

Thank you! If anyone got the error
ERROR 1194 (HY000): Table 'user' is marked as crashed and should be repaired ERROR: No query specified
after running this SELECT * FROM user \G;
Then to repair the table you can use the following command
REPAIR TABLE user;

@alem2019

alem2019 commented Oct 6, 2019

Copy link
Copy Markdown

Worked. Great!

@mootlyfool

Copy link
Copy Markdown

I am using a fresh install of XAMPP on a Windows 10 machine. The install goes great but as soon as I change the password for localhost:root I am locked out of the admin section for MySQL. I was able to bypass password checking with the skip-grant-tables line, but unable to reset the password for root users - I get a message that changes are not allowed to the column. I did not have this problem on a previous machine / install and am completely unable to determine a cause for this problem. Any suggestions as to how to change the root password and still be able to use the admin functions in XAMPP?

@FatmaUc

FatmaUc commented Sep 4, 2020

Copy link
Copy Markdown

Hi, i am receiving " Column 'Password' is not updatable" error.

How can i resolve it.
your help will be much appreciated

@jonsnowsz89

Copy link
Copy Markdown

Thank you very much .

@rulisastra

Copy link
Copy Markdown

Hi, i am receiving " Column 'Password' is not updatable" error.

How can i resolve it.
your help will be much appreciated

yah, how did you solved it?

@arpitasth

Copy link
Copy Markdown

Thanks susanBuck, it worked for me

@Kaira2112

Copy link
Copy Markdown

Thank u a lot !
U saved me from hassle πŸ™ƒπŸ˜˜

@NicolaChiesa

Copy link
Copy Markdown

Hi, i am receiving " Column 'Password' is not updatable" error.

How can i resolve it. your help will be much appreciated

i have the same problem...

@dhirajgaikwadb

Copy link
Copy Markdown

me too can you give us solution

@go2amp

go2amp commented May 16, 2023

Copy link
Copy Markdown

ERROR 1348 (HY000): Column 'Password' is not updatable

Not a solution.

@emjayceee

Copy link
Copy Markdown

yep, got the ERROR 1348 (HY000): Column 'Password' is not updatable... :'>

@kaeg07

kaeg07 commented Oct 20, 2025

Copy link
Copy Markdown

after typing C:\xampp\mysql\bin\mysql.exe I get:
ERROR: Unknown command '\x'.
ERROR: Unknown command '\m'.
ERROR: Unknown command '\b'.
ERROR: Unknown command '\m'. Idk why :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment