Search code examples
google-cloud-sqlgcloud

gcloud Export to Google Storage Bucket from Cloud SQL instance


Running this command:

 gcloud sql instances export myinstance gs://my_bucket_name/filename.csv -d "mydatabase" -t "mytable" 

Giving me the following error:

  ERROR: (gcloud.sql.instances.import) ERROR_RDBMS

I have manually ran console uploads to the bucket which go fine. I am able to login to the sql instance and run queries. Which makes me think that there are no permission issues. Has anybody ever seen this type of error and knows a way around it?

Note: i have googled for possible situations, and most of them point to either sql or bucket permission issues.


Solution

  • Nvm. I figured out that i need to make an oauth connection (using the json token generated from gcloud api/credentials section) to the instance before interacting with it.