Exporting database using thesql command line

exportmariadb

I am using mysql to export a database from my application, the options I have so far:

--skip-comments
--compact
--lock-tables=false
--add-drop-database
--host=localhost
--user=trainer
--password=XXXX
--routines
--databases
training

The above are from a String list (a collection of strings, in this case a Qt QStringList. (C++).). The executable is mariadb-dump.exe

When the file is generated using the above I see in the file:

CRLF
/*!40000 DROP DATABASE IF EXISTS `training`*/;CRLF

There are several lines that have comments in them like this, does this mean the above will not be executed? If Yes, how to I fix this in the export so these lines are not commented out?

Best Answer

This is a conditional syntax.

/*!XXXXXX .... */

means that statement will be executed if current mariadb version is equal to or higher than XXXXXX. In your case database training will be dropped if server you have dump loaded to is of version 4.0 or higher.

Related Question