如何更改mysql root密码 [英] How to change mysql root password
问题描述
我正在尝试更改机器上的mysql root密码.另一位工程师创建了密码并离开了公司,所以我没有访问权限.我宁愿不必重新安装整个shebang.
I'm trying to change the mysql root password on my machine. Another engineer created the password and left the company so I don't have access. I'd rather not have to reinstall the whole shebang.
我正在尝试按照此处的说明进行操作: http: //dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html
I'm trying to follow the instructions here: http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html
但是,当我在重置根密码:Unix系统"指令的第2步上执行命令时,出现以下错误:
But when I execute the command on step 2 of the "Resetting the Root Password: Unix Systems" instructions I get the following error:
FitValet-MacBook-Pro:~ fitvalet$ kill `cat /usr/local/mysql/data/FitValet-MacBook-Pro.local.pid`
cat: /usr/local/mysql/data/FitValet-MacBook-Pro.local.pid: Permission denied
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
我一生都无法解决...权限被拒绝了吗?我该如何克服?谢谢!
And I can't figure it out for the life of me...permission is denied? How can I get past this? Thanks!
推荐答案
尝试在kill
和cat
命令之前添加sudo
.像这样:
Try adding sudo
in front of the kill
and cat
commands. Like this:
sudo kill `sudo cat /usr/local/mysql/data/FitValet-MacBook-Pro.local.pid`
然后它将询问您Mac(不是mysql)的root密码.输入它,命令应该执行而不会给您拒绝权限的错误.
It will then ask you for the root password for your Mac (not mysql). Enter it, and the command should execute without giving you a permission denied error.
这篇关于如何更改mysql root密码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!