12

I have installed xampp, I did the security settings, but after a time I have forgot the root password. I have google it, how to reset, the problem seems he can't create lower-lower-test file, because he try to accesss a Unix path on my windows PC :), lol. xamp config.

the resetroot.bat gives me this output:

101108 15:37:23 [Warning] Can't create test file \usr\local\mysql\data\MYCOMPUTERNAME.lower-test
101108 15:37:23 [Warning] Can't create test file \usr\local\mysql\data\MYCOMPUTERNAME.lower-test
mysql\bin\mysqld.exe: Can't change dir to '\usr\local\\mysql\data\' (Errcode: 2)
101108 15:37:23 [ERROR] Aborting

101108 15:37:23 [Note] mysql\bin\mysqld.exe: Shutdown complete


Passwoerter fuer Benutzer "root" und "pma" wurden nicht geloescht!
Passwords for user "root" and "pma" were not deleted!

Press any key to continue . . . 

The .bat file has the following important parts:

PUSHD %~dp0
CD ..
mysql\bin\mysqld.exe --no-defaults --bind-address=127.0.0.1 --bootstrap --console --skip-grant-tables --skip-innodb --standalone resetroot.err 2>&1
IF ERRORLEVEL 1 GOTO FEHLER
GOTO KEINFEHLER

:FEHLER
TYPE resetroot.err
ECHO.
ECHO Passwoerter fuer Benutzer "root" und "pma" wurden nicht geloescht!
ECHO Passwords for user "root" and "pma" were not deleted!
GOTO WEITER

:KEINFEHLER
ECHO.
ECHO Passwoerter fuer Benutzer "root" und "pma" wurden geloescht.
ECHO Passwords for user "root" and "pma" were deleted.
ECHO.
ECHO Bitte den MySQL Server neu starten.
ECHO Please restart the MySQL server.
GOTO WEITER

:WEITER
DEL resetroot.err >nul 2>&1
DEL resetroot.sql >nul 2>&1
ECHO.

POPD
PAUSE

at mysql bin directory is a my.ini file

# Point the following paths to different dedicated disks
tmpdir           = "C:/xampp/tmp/"

Don't know from where is coming that Unix path and where to change, what parameter.

Is there any other way to reset the mysql root password until I have this errors?

3
  • @AndreKR has answered this question. This needs to be set as "answered".
    – joshmax
    Commented Dec 6, 2011 at 17:35
  • @joshmax: This user hasn't ever come back since he posted this question. Nobody can accept answers except the question asker, so we'll have to leave this question as it is.
    – BoltClock
    Commented Dec 6, 2011 at 18:00
  • @BoltClock Gotcha. Too bad... It was a helpful answer.
    – joshmax
    Commented Dec 6, 2011 at 18:59

3 Answers 3

79

I'd suggest to forget the bat file and do it manually:

  • Go to your xampp\mysql\bin\ folder
  • Edit my.ini and insert skip-grant-tables below [mysqld]
  • Restart MySQL
  • Set new password for your root user by running UPDATE mysql.user SET Password=PASSWORD('new_password') WHERE User='root' in phpMyAdmin in the mysql database (or just leave it like this if MySQL cannot be accessed from remote hosts)
4
  • 1
    +1! Wonderful. I've been w/o access to phpMyAdmin/MySQL for far too long! Thanks! I hope @matheszabi accepts this answer soon.
    – joshmax
    Commented Dec 6, 2011 at 17:33
  • 5
    The skip-grant-tables makes any password work for the user, so you should comment it out after changing the password. Otherwise a good answer.
    – Pavel V.
    Commented Dec 8, 2014 at 9:04
  • THANK YOU! This totally worked -- I almost uninstalled XAMPP and started over.
    – mikeabout
    Commented Nov 1, 2015 at 2:42
  • Thank you very much.Your answer ended my 6 hours struggle. Commented Jul 4, 2018 at 14:56
5

Here is a great link

In short goto

http://localhost/security/

and there you can reset the password. It is web interface rather than you have to look for a file somewhere.

2
  • On some newer installs of XAMPP the URL might be this for English speaking users localhost/security/lang.php?en Commented Apr 1, 2015 at 13:26
  • Both link are #404 :D. Any suggestion !!
    – CoDe
    Commented Aug 1, 2016 at 9:43
1

I face the same problem & simply update the password with below SQL query With HeidiSQL (Free mySQL editor).

UPDATE mysql.user SET Password=PASSWORD('your_password') WHERE User='root'

Then, stop mysql from xampp control panel & start it again.

Not the answer you're looking for? Browse other questions tagged or ask your own question.