Using the anonymous mysql account on RoR
I know that for a safe data开发者_运维问答base there needs to be a username and a password. However, I was curious as why ruby on rails does not allow you to use an anonymous account on mysql. I have tried keeping the username and password lines empty in the database.yml
May be I am not understanding exactly where the database information is stored on a RoR application. I have also tried to go to the mysql2 directory under "Ruby192\lib\ruby\gems\1.9.1\gems\mysql2-0.2.6-x86-mingw32" (this is the version i am using just to let u guys know). But I dont really know where to look.
If anyone has any ideas, or an explanation as whether ruby even allows u to access the database without a username and a password.
What error are you seeing?
Password definitely is not required in the config, but if I try setting the username to blank, and inspect ActiveRecord::Base.connection in the console, I can see it's defaulted back to using root.
精彩评论