There are three general ways to invoke mysqldump:
In its simplest form, the mysqldump utility can be used like this:
mysqldump –-user [user name] –-password=[password] [database name] > [dump file]
this will include both the schema and data as well.
If you need only the schema use the -d or --no-data option
e.g. mysqldump -d -u root -pp@ssword mydatabase > mydatabase.sql
Reference: MySQL :: MySQL 5.0 Reference Manual :: 4.5.4 mysqldump — A Database Backup Program
Update: You no longer need that if you use the MySQL Connector/Net 5.2 or later.
- Download the source code for the MySQL Connector/Net from www.mysql.com.
- Extract the contents of the zip file to a local directory.
- Open mysql.csproj project file in Visual Studio.
- Open the AssemblyInfo.cs file, and add the following code, in the using block, at the top of the file (if it is not already there):using System.Security;
- Add the following code to the assembly section of the file:[assembly: AllowPartiallyTrustedCallers]
- Recompile the dll.
You may now reference this dll from other projects. When you decide to publish your project to your hosting server, you need to upload this modified version of the dll to your bin directory.
Via How do I Recompile the MySQL Library to Run Under the Medium Trust Environment? – Help Center—Knowledge Base and FAQ