如何返回我的MySQL密码,以便我可以耙db:create on rails? [英] How can I rework my MySQL password so that I can rake db: create on rails?

查看:237
本文介绍了如何返回我的MySQL密码,以便我可以耙db:create on rails?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



当我db:rake create,我得到以下:
访问被拒绝的用户'root '@'localhost'(使用密码:NO)。
请提供您的my​​sql安装的根密码
>
rake aborted!



没有设置密码。我已经搜索整天stackoverflow和谷歌。
我甚至为它设置了密码并尝试了。



是的,我去过 http://dev.mysql.com/doc/refman/5.0/en/resetting -permissions.html#resetting-permissions-unix



但是当我按照说明重置密码时,终端和我自己无法找到.pid文件!



我尝试过使用带有--skip-grant-tables选项的mysqld_safe选项,并结束:



110821 23:32:22 mysqld_safe从/ usr / local / var / mysql中的数据库启动mysqld守护程序
rm:/tmp/mysql.sock:权限被拒绝
110821 23:32:24 mysqld_safe mysqld from pid file /usr/local/var/mysql/Tony-Ngs-MacBook-Air.local.pid ended

解决方案

我相信你只需要在你的database.yml文件中添加密码。这是当客户端连接到mysql没有指定密码,而不是服务器的配置问题(虽然它看起来像这样的短语)时显示的错误。



如果您需要在MySQL中设置密码,请使用授予选项:

  GRANT ALL ON *。* TO'railsuser'@'localhost'IDENTIFIED BY'password'; 


I've very much so tried it all.

when I db:rake create, I get the following: Access denied for user 'root'@'localhost' (using password: NO). Please provide the root password for your mysql installation > rake aborted!

There is no password set. And I've searched all day on stackoverflow and on google. I've even set a password for it and tried that out.

Yes, I've been to http://dev.mysql.com/doc/refman/5.0/en/resetting-permissions.html#resetting-permissions-unix

But when I followed the instructions to reset the password, terminal and myself are unable to locate the .pid file!

I've tried using the mysqld_safe with --skip-grant-tables option and wound up with this:

110821 23:32:22 mysqld_safe Starting mysqld daemon with databases from /usr/local/var/mysql rm: /tmp/mysql.sock: Permission denied 110821 23:32:24 mysqld_safe mysqld from pid file /usr/local/var/mysql/Tony-Ngs-MacBook-Air.local.pid ended

解决方案

I believe you just need to add the password in your database.yml file. That's an error that's displayed when the client connecting to mysql didn't specify a password, not a configuration issue with the server (although it does appear that way with the phrasing).

If you need to set your password in MySQL, you do it with a grant option:

GRANT ALL ON *.* TO 'railsuser'@'localhost' IDENTIFIED BY 'password';

这篇关于如何返回我的MySQL密码,以便我可以耙db:create on rails?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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