开发者

Do I need to do a MySQL password reset and if so, how do I locate the init.d file?

I'm tring to learn some MySQL to set up a database and one of the steps is:

mysql -u root --password=9898

It gives me this :

ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

I don't think I'm using the wrong password but ok, I guess I need to reset the password. Is there another possibility?开发者_C百科

I found a link on Stackoverflow http://www.cyberciti.biz/tips/recover-mysql-root-password.html with some instructions so I could do a reset but I'm stuck again. I need to locate the init.d file but I don't know how.

Any help is appreciated.

Thank you.


Sometimes MySQL can be fussy with spacing and extra characters. Does this work?

mysql -uroot -p9898

Regardless, you can always add an inti_file to your my.cnf which contains a single line, something like

   GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY '9898' WITH GRANT OPTION

and restart your MySQL service.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜