2011-06-16 104 views
0

我創建了項目。在開發模式下工作!優秀!僅在生產中出現錯誤!

發展: 打字:ruby lib/scripts/test_sync.rb

而且我的腳本作品!

生產: 打字:ruby lib/scripts/test_sync.rb

獲取Access denied for user 'root'@'localhost' (using password: YES)

不知道,我所做的一切。授予previligies,更改密碼等... Coul某人幫助我,請嗎?

UPD *

# SQLite version 3.x 
# gem install sqlite3-ruby (not necessary on OS X Leopard) 
development: 
    adapter: mysql 
    host:  localhost  
    database: survey_development 
    username: root 
    password: 
    encoding: utf8   

# Warning: The database defined as "test" will be erased and 
# re-generated from your development database when you run "rake". 
# Do not set this db to the same as development or production. 
test: 
    adapter: mysql 
    host:  localhost  
    database: survey_development 
    username: root 
    password: 
    encoding: utf8 

production: 
    adapter: mysql 
    host:  survey 
    database: survey_production 
    username: survey 
    password: 
    encoding: utf8 

mossad: 
    adapter: mysql 
    host:  baza 
    database: baza_production 
    username: baza_survey 
    password: 
    encoding: utf8 
+1

也許問題是與你的database.yml文件,嘗試在生產與相同的憑據運行mysql你在你的文件中提到 – usmanali 2011-06-16 09:34:02

+0

我認爲是一樣的,但不能看到任何關鍵:S – 2011-06-16 09:37:57

+0

也許問題是與摩薩德。摩薩德和密碼不能很好地混合在一起。 – 2013-04-11 17:35:07

回答

0

嘗試增加RAILS_ENV =生產

+0

我在shoudl寫入test-sync.rb是嗎? – 2011-06-16 09:37:08

0

您的登錄/密碼對不正確,在database.yml的MySQL數據庫。

編輯

您應該刪除您的密碼,如果行不存在:

production: 
    adapter: mysql 
    host:  survey 
    database: survey_production 
    username: survey 
    encoding: utf8 
+0

我查了大約100次,一切都好; [ – 2011-06-16 13:31:58

+0

不是,因爲'Axxess dinied'。你可以顯示你的database.yml – fl00r 2011-06-16 13:41:06

+0

更新了我的問題! – 2011-06-16 14:52:57

相關問題