我正在嘗試使用此處描述的從應用程式引擎將 csv 檔案匯入到云 sql 。
雖然這可以在本地作業,但在應用程式引擎上運行時會失敗:
googleapiclient.errors.HttpError: <HttpError 403 when requesting https://sqladmin.googleapis.com/v1/projects/xxxxxx/instances/yyyyyy/import?alt=json
returned "Request had insufficient authentication scopes."
Details: "[{'message': 'Insufficient Permission', 'domain': 'global', 'reason': 'insufficientPermissions'}]">"
如何將范圍添加到我的應用引擎標準實體?
uj5u.com熱心網友回復:
解決方案結果如下:
import google.auth
# next line had wrong scope
SCOPES = ['https://www.googleapis.com/auth/cloud-platform']
credentials, _ = google.auth.default(scopes=SCOPES)
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/433875.html
