用错误的mysql配置重置root密码 [英] reset root password with wrong mysql config

查看:51
本文介绍了用错误的mysql配置重置root密码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了xampp,我进行了安全设置,但是过了一段时间,我忘记了root密码.我有谷歌它,如何重置,问题似乎他不能创建低下测试文件,因为他试图访问我的Windows PC上的Unix路径:),大声笑. xamp配置.

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.

resetroot.bat给我这个输出:

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 . . . 

.bat文件具有以下重要部分:

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

在mysql bin目录中是一个my.ini文件

at mysql bin directory is a my.ini file


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

不知道Unix路径从何而来以及要更改的地方,什么参数.

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

在出现此错误之前,还有其他方法可以重置mysql根密码吗?

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

推荐答案

我建议忘记bat文件并手动进行操作:

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

  • 转到您的xampp \ mysql \ bin \文件夹
  • 编辑 my.ini 并在[mysqld]
  • 下插入skip-grant-tables
  • 重新启动MySQL
  • 通过在 mysql 数据库中的phpMyAdmin中运行UPDATE mysql.user SET Password=PASSWORD('new_password') WHERE User='root'为根用户设置新密码(或者,如果无法从远程主机访问MySQL,则像这样保留该密码)
  • 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)

这篇关于用错误的mysql配置重置root密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆