I need to export some data from different tables. I tried this query

select * into outfile 'C:\Users\\User\\Desktop\\ololo.sql' from db.users where id % 2 = 1;

After this query, the SQL file was created. When I use id i in the the same query to export data from other table. Thus, an error happens. I need additional data from the other table. So, the result must be not dump of all database but part of it. Thanks for your answers.


You need to use mysqldump option --where like this:

mysqldump -uroot -p --where="id % 2 = 1" db users > C:\Users\User\Desktop\ololo.sql

Give it a Try !!!

  • oh, thanks, its works. but how to add to this sql file data from other table? i want parts of different tables in one file. Mar 26 '14 at 15:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.