简体   繁体   English

Rails无法识别对MySQL数据库的更改

[英]Rails not recognizing changes to mysql database

I have a rails app that uses mysql as the database. 我有一个使用mysql作为数据库的Rails应用程序。 I've done an sqldump, created a database (called local_prod), and imported the dump into the database. 我完成了一个sqldump,创建了一个数据库(称为local_prod),并将转储导入到数据库中。 When I try to access the database information with my rails app, it doesn't see any of the data that is in the database. 当我尝试使用Rails应用程序访问数据库信息时,它看不到数据库中的任何数据。 Any idea why this is happening? 知道为什么会这样吗?

When I call for the object I'm looking for through the web app, it returns nil. 当我通过网络应用程序调用要查找的对象时,它返回nil。 Here is the sql select statement that is run: 这是运行的sql select语句:

Bound Load (0.5ms)  SELECT  `bounds`.* FROM `bounds` WHERE `bounds`.`city` = 'boston' AND `bounds`.`state` = 'ma' ORDER BY `bounds`.`id` ASC LIMIT 1

When I copy and paste that same statement into the mysql console in my terminal, it returns all the data I am looking for. 当我将同一条语句复制并粘贴到终端的mysql控制台中时,它将返回我要查找的所有数据。

Here is my database.yml file as well: 这也是我的database.yml文件:

development:
 adapter: mysql2
 database: local_prod 
 host: localhost
 username: root
 password:
 socket: /tmp/mysql.sock

您确定您的sql db没有root密码?

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

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