0

I have a huge amount of data in MariaDB. I need to do create dump files from queries. So far I got something like this.

SELECT DISTINCT uretici INTO OUTFILE '/home/admin/web/example.com/public_html/public/manufacturers.sql' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY '\n' FROM data;

This gives me a SQL file which is cant be imported. I need an importable SQL file. What to do about it?

1

1 Answer 1

3

You can use the following command

mysqldump -u [database_user] -p [database_name] | gzip > [filename_to_compress.sql.gz]
Sign up to request clarification or add additional context in comments.

2 Comments

If you need any clarifications please let me know
Thank you for your answer samuel. I solve this problem while ago with the following command. ``` mysqldump -u root -pxxx admin_tecalliance data -w "oem_no IS NOT NULL " > file.sql;" ```

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.