Wednesday, May 5, 2021

[google-cloud-sql-discuss] Re: Export from CloudSQL to CSV using select * into outfile

Hello,


I understand that you would like to restore data from Cloud SQL to a Cloud Storage bucket but you are receiving Error 1227[1]. I was able to find an explanation indicating that this operation needs a Super User permission[2] that a managed Cloud SQL does not offer at this moment.

I was able to find this document[3], which describes how to generate a CSV from Cloud SQL as an alternative.

Would this be a sufficient workaround for you? I know this must be frustrating not to have technology not behaving as you wish. Please let us know your thoughts.

I would believe that the community may offer further advice or other ways to accomplish what you would like to do in another way in addition to the one I suggested.


[1] https://forums.mysql.com/read.php?10,674692,674692

[2] https://www.virtual-dba.com/blog/mysql-error-1227-access-denied/#:~:text=The%20reason%20MySQL%20throws%20error,the%20user%20importing%20the%20data.

[3] https://cloud.google.com/sql/docs/mysql/import-export/exporting



On Wednesday, May 5, 2021 at 9:11:43 AM UTC-4 rgo...@ctepl.com wrote:
Hi,

I am trying to generate csv file from cloudsql and place in cloud storage using below query:

select * INTO OUTFILE 'Cloudstorage_path/test.csv'         FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'         LINES TERMINATED BY '\n' from Table limit 10

But I am getting below error:
Error Code: 1227. Access denied; you need (at least one of) the FILE privilege(s) for this operation

Please confirm whether we can use this approach to push data from cloudsql to cloud storage.

--
You received this message because you are subscribed to the Google Groups "Google Cloud SQL discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-cloud-sql-discuss+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-cloud-sql-discuss/1ecbd650-c756-4ba6-a208-9d09a2c5e0bbn%40googlegroups.com.

No comments:

Post a Comment