iT邦幫忙

0

heroku cleardb 無法使用

小弟我在自己電腦上(windows)使用python存取heroku clearDB資料庫,可以正常存取,也都有讀取到資料,但是將程式上傳至heroku後,卻讀取不到資料一直顯示None,想請問一下該如何解決。

https://ithelp.ithome.com.tw/upload/images/20211030/20112748FEV98nxa8O.png

https://ithelp.ithome.com.tw/upload/images/20211030/20112748ZT5OKVw0JC.png

https://ithelp.ithome.com.tw/upload/images/20211030/20112748WZYSvbDUYh.png

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

1 個回答

2
huahualiu
iT邦新手 2 級 ‧ 2021-10-30 11:15:37

沒有看到雲端服務的設定其實也很難知道具體原因可能是什麼
只能提供幾個可能可以排除問題的思路,你參考:

  1. SQL 語法中,有些資料庫字串只能吃單引號,如果給雙引號可能會出錯,你的code看起來有做類似處理,可能系統不同導致讀取出問題。
  2. windows sys 轉 Linux sys 可能會遇到路徑的問題,windows 路徑表達用「\」,Linux 用「/」,如果設錯,在轉換時也可能錯。
  3. 雲端設定問題,可能你的系統跟資料庫沒有連上,導致吐不出資料,可能要檢查一下內網連線設定

我要發表回答

立即登入回答