Export mysql data to csv

Asked

Viewed 605 times

0

I am trying to export specific data from a client database to csv, I searched the internet and said I would achieve using the code below.

SELECT * FROM escola
INTO OUTFILE '/var/lib/mysql-files/orders.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n';

However when I use it appears: "error SQL 1045" Access denied for user 'Forms'@'%'(using password: YES)". I searched in the mysql forum itself, and I found information saying that I would have to enter as administrator in the bank to change the user with problem, however I can not have this access. Would you have another way to export? or to resolve this error?

I’m thinking of doing it with python, using several selects and treating the data for creating csv, but I think it’s an unnecessary effort.

I’m using Heidisql 9.5.0

  • One question: does the directory accept write; are permissions suitable? Or is the Orders.csv file no longer open?

  • On the directory, yes, I would be accessing the database that is on the client server and saving in the directory on my machine. I have permission to enter and delete in the database, however I am not allowed to change tables, create and etc... The Orders.csv file would be the csv file I want Heidi to create for me

  • I believe saving to your machine is not possible due to network security. Maybe I can only save to a server directory, but I’m not sure.

  • Have another way to export without having to use python?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.