Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

xampp - reset root password with wrong mysql config

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 usrlocalmysqldataMYCOMPUTERNAME.lower-test
101108 15:37:23 [Warning] Can't create test file usrlocalmysqldataMYCOMPUTERNAME.lower-test
mysqlinmysqld.exe: Can't change dir to 'usrlocal\mysqldata' (Errcode: 2)
101108 15:37:23 [ERROR] Aborting

101108 15:37:23 [Note] mysqlinmysqld.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 ..
mysqlinmysqld.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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

  • Go to your xamppmysqlin 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)

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...