I couldn't find any information about how to dump a MySQL database with an ant task.
Do I have to create my own task to do this?
ANT script ===generate==> myDataBase.sql
To dump entire databases, do not name any tables following db_name , or use the --databases or --all-databases option. To see a list of the options your version of mysqldump supports, issue the command mysqldump --help .
Create a target that runs the "mysqldump" command like this:
<target name="dump-database">
<exec executable="mysqldump" output="database-dump.sql">
<arg value="--user=username" />
<arg value="--password=password" />
<arg value="--host=localhost" />
<arg value="--port=3306" />
<arg value="mydatabase" />
</exec>
</target>
Now you can make the dump by executing ant dump-database
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With