0

I found more than one post saying that to accomplish the task we have to run

SELECT * INTO OUTFILE 'file.csv'
    FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
    LINES TERMINATED BY '\n'
FROM table

If I run this as administrator I get

Error Code: 1227. Access denied; you need (at least one of) the FILE privilege(s) for this operation

To fix this we need to run

GRANT FILE ON *.* TO 'user'@'localhost';

where user is the admin user

If I do that I get

Error Code: 1045. Access denied for user 'user'@'%' (using password: YES)

And here I am stuck.

Note. I tried exporting the data with Workbench. The process starts and never stops. After waiting 15 hours I had to stop it. It seems that exporting large tables (like the one I want to export) with Workbench doesn't work.

Note. It seems that Azure MySQL doesn't support INTO OUTFILE command. But there is no indication on alternatives to export data to CSV

Can someone please advise on how to export a big table out of an Azure MySQL database into a CSV file?

Franco Tiveron
  • 2,364
  • 18
  • 34
  • Use Azure data factory or Synapse Analytics [copy activity](https://learn.microsoft.com/en-us/azure/data-factory/connector-mysql?tabs=data-factory) to copy data from Azure MySQL table to csv file – Aswin Oct 10 '22 at 02:04

0 Answers0