How can I rework my MySQL password so that I can rake db: create on rails?

走远了吗. 提交于 2019-12-08 04:41:00

问题


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


回答1:


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';


来源:https://stackoverflow.com/questions/7143891/how-can-i-rework-my-mysql-password-so-that-i-can-rake-db-create-on-rails

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