2014-01-21 33 views
2

我的django安裝程序需要連接到mysql後端。我收到以下錯誤:如何在連接到mysql時告訴django使用--skip-secure-auth?

(2049, "Connection using old (pre-4.1.1) authentication protocol refused (client option 'secure_auth' enabled)") 

周圍的Googling告訴我那是錯誤意味着我需要使用「--skip-安全-auth的」命令行開關。我找不到任何方法讓django使用這個開關,或者它是相同的。

我該怎麼做? (或者,如果我遠離基地,什麼是真正的問題。)

回答

0

你試過OPTIONS

DATABASES = { 
    'default': { 
     'ENGINE': 'django.db.backends.mysql', 
     'OPTIONS': { 
      'secure-auth': False, 
     }, 
    } 
} 

來源:

django documentation mysql documentation

+0

這是我想的第一件事。我得到一個「TypeError:關鍵字必須是字符串」的MySQLdb –

+0

http://dpaste.com/hold/1564492/ –

+0

可能是這樣的:''secure-auth':'False''? –