[英]resetting mysql workbench root password
I am trying to reset the root password for mySQL Workbench since I forgot it. 我正在尝试重置mySQL Workbench的root密码,因为我忘了它。 I was reviewing some online tutorials of how to do this, and they all speak of a "bin" folder.
我正在审查一些如何执行此操作的在线教程,他们都谈到了“bin”文件夹。 I went to the program folder, and didn't see a bin folder.
我去了程序文件夹,没有看到bin文件夹。 How do I do this?
我该怎么做呢?
Reset MySQL root password official documentation has cases for Windows and Unix systems, and a "generic" instruction at the end of the document. 重置MySQL root密码官方文档包含Windows和Unix系统的案例,以及文档末尾的“通用”指令。 Hope that helps.
希望有所帮助。
spsv mysql*
kill -f -Pro mysqld -ErrorA Ignore
ri C:\temp.txt
ni -t f C:\temp.txt
ac C:\temp.txt "UPDATE mysql.user SET Password=PASSWORD('4321') WHERE User='root';"
ac C:\temp.txt "FLUSH PRIVILEGES;"
$defaultsFile = (gci -r -Path "C:\ProgramData\MySQL" -include my.ini).FullName
cd "C:\Program Files\MySQL\MySQL Server*\bin"
& .\mysqld.exe --defaults-file="$defaultsFile" --init-file="C:\\temp.txt"
ps mysqld | kill -f
sasv "MySql*"
& .\mysql -u root -p4321
\q
C:\\
, then add reset password commands; C:\\
创建,然后添加重置密码命令; ri
removes any existing temp.txt file. ri
删除任何现有的temp.txt文件。 (gwmi win32_service | ?{$_.Name -like 'mysql*'} | select -First 1).PathName
. (gwmi win32_service | ?{$_.Name -like 'mysql*'} | select -First 1).PathName
。 *
in the path means that we don't have to know our version number. *
表示我们不必知道我们的版本号。 &
makes PowerShell run the exe
like the command line does. &
使PowerShell像命令行一样运行exe
。 Once you run this, PowerShell will appear to hang - that's because it's running the mysqld
process. mysqld
进程。 bin
. bin
。 After the test, you should see mysql>
. mysql>
。 Use \\q
to quit. \\q
退出。 http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html
Hey if you are on Windows 7 like me you will find the MySQL executables here: C:\\Program Files\\MySQL\\MySQL Server 5.5\\bin . 嘿,如果你像我一样在Windows 7上,你会在这里找到MySQL可执行文件:C:\\ Program Files \\ MySQL \\ MySQL Server 5.5 \\ bin。 I used mysqld.exe, because mysqld-nt.exe doesn't exist anymore in newer versions of MySQL.
我使用了mysqld.exe,因为mysqld-nt.exe在较新版本的MySQL中不再存在。
After following the instructions in the documentation you should have a command similar to this: C:\\Program Files\\MySQL\\MySQL Server 5.5\\bin>mysqld.exe --defaults-file="C:\\Program Files\\MySQL\\MySQL Server 5.5\\my-medium.ini" --init-file=C:\\mysql-initRootPass.txt 按照文档中的说明操作后,您应该有一个与此类似的命令:C:\\ Program Files \\ MySQL \\ MySQL Server 5.5 \\ bin> mysqld.exe --defaults-file =“C:\\ Program Files \\ MySQL \\ MySQL Server 5.5 \\ my-medium.ini“ - init-file = C:\\ mysql-initRootPass.txt
Note: make sure you run the CMD.exe as Administrator. 注意:确保以管理员身份运行CMD.exe。 For the most part that fixed it for me.
在大多数情况下为我修复它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.