Issue
- I am using the MySQL Client of Liferay Cloud and I want to export the contents of a table to a file, with a command like
select * from User_ into outfile '/tmp/users.txt';
but it fails with Error 1045 Access denied for user...
Environment
- Liferay Cloud
Resolution
-
The reason the "select into outfile" command doesn't work is that for security reasons we can't write to the remote MySQL server disk, which is what INTO OUTFILE is attempting to do. As a workaround, you might want to pipe the output of the select into a file from command line. Something along the lines of
mysql -e "select * from User_" > /opt/liferay/users.txt
Additional Information
- For more information on (unsupported) ways of possibly downloading to your PC those files after that, please see How to download a file I created on the Liferay service in Liferay PaaS