How to change mysql root password

本小妞迷上赌 提交于 2019-12-11 06:14:03

问题


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.

I'm trying to follow the instructions here: http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html

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!


回答1:


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`

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.



来源:https://stackoverflow.com/questions/18517410/how-to-change-mysql-root-password

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!