I’m facing an issue with using mysqldump inside a batch script to backup a database with certain conditions. The problem arises when I add multiple condition sets inside an IN clause.
For example, the following command works fine:
mysqldump -u root -ppass --where="[some_column_name]=[somevalue] AND NAME IN ('value1','value2')" dbname tablename > [path]/filename.sql
However, when I attempt to add a large number of possible values for a column within the IN clause (say, 1000 values), I encounter an error stating that > is not recognized as a table. I suspect there might be a character limit to this command.
Here’s the problematic command:
mysqldump -u root -ppass --where="[some_column_name]=[somevalue] AND NAME IN ('value1','value2',.....,'value1000')" dbname tablename > [path]/filename.sql
Any insights or suggestions would be greatly appreciated.
Thank you!