16

Looking at a mySQL Dump, I have come across something and like to know what they are.

I see:

/*!50001 DROP TABLE IF EXISTS `xxx` */;

What is the flag 50001, is there a list of what they mean?

3 Answers 3

21

It is discussed on the MySQL's forums/mailing lists here.

/*!50001 DROP TABLE `category_count_view`*/; 

This is a "feature" of MySQL. Any other RDBMS will treat this as a comment.

But, MySQL looks at 50001 and checks that as a MySQL version. This is Version 5.00.01, or 5.0.1 in the real world, but leaves room for the the sub-version and release to be greater than 9.

MySQL will treat the line as a comment if MySQL is below 5.0.1, and will process the line if MySQL is greater than or equal to 5.0.1.

It's a way making a SQL script compatible with different versions of MySQL, and allows new features to be included.

4

The 500001 is regarding the MySQL version that generated the file.

This would be 5.00.01 or 5.0.01

3

50001 is a value that indicate your mysql version.

This is Version 5.00.01, or 5.0.1 in the real world, but leaves room for the the sub-version and release to be greater than 9.

It's a way making a SQL script compatible with different versions of MySQL, and allows new features to be included.

2
  • If its the version, whats CREATE DATABASE /*!32312 IF NOT EXISTS*/YYY /*!40100 DEFAULT CHARACTER SET latin1 */; Commented Feb 18, 2014 at 13:58
  • 32312 is similar, but the version of the mysql server
    – Ganz
    Commented Feb 18, 2014 at 14:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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