简体   繁体   English

Rails服务器Mysql2 :: Error

[英]Rails server Mysql2::Error

I'm brand new to developing and ruby on rails. 我是开发人员和红宝石的新手。 I'm on Windows 7, have ruby 2.1.6 , rails 4.2.3 , MySQL 5.6.26 , and Sublime Text 2 (2.0.2) installed. 我在Windows 7上,安装了ruby 2.1.6rails 4.2.3MySQL 5.6.26Sublime Text 2 (2.0.2) I'm following an online tutorial on lynda.com about ruby on rails 4 essentials and ran into a problem trying to connect with my localhost:3000 rails server. 我在lynda.com上关注有关ruby on rails 4基本知识的在线教程,尝试连接localhost:3000 rails服务器时遇到问题。 I'm getting this error every time. 我每次都会收到此错误。

Mysql2::Error (Access denied for user 'root'@'localhost' (using password: NO)) Mysql2 :: Error(拒绝访问用户'root'@'localhost'(使用密码:NO))

and then a whole bunch of lines of code in the command prompt I don't understand. 然后在我不理解的命令提示符中有一整行代码。 I need some help sorting this out please! 我需要一些帮助来解决这个问题!

Go to your_app/ config/database.yml and in username insert your MySQL username (ex. Root) and in password your MySQL password. 转到your_app / config / database.yml,在用户名中输入您的MySQL用户名(例如Root),并在密码中输入MySQL密码。 Don't forget to fill also the field "database". 不要忘记也填写“数据库”字段。

The error is caused by wrong credentials. 该错误是由错误的凭据引起的。 You must set database_name, user_name and password. 您必须设置数据库名称,用户名和密码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM