When running a script file, you often see the following information :! 40101SET @ OLD_CHARACTER_SET_CLIENT @ CHARACTER_SET_CLIENT ;! 40101SET @ OLD_CHARACTER_SET_RESULTS @ CHARACTER_SET_RESULTS ;! 40101SET @ OL:
/! 40101 SET @ OLD_CHARACTER_SET_CLIENT = @ CHARACTER_SET_CLIENT /;
/! 40101 SET @ OLD_CHARACTER_SET_RESULTS = @ CHARACTER_SET_RESULTS /;
/! 40101 SET @ OLD_COLLATION_CONNECTION = @ COLLATION_CONNECTION /;
/! 40101 set names UTF8 /;
/! 40103 SET @ OLD_TIME_ZONE = @ TIME_ZONE /;
Obtain /! Code ...... /Is explained as follows:
The MySQL server contains some extensions not available in other SQL DBMS. Note: If they are used, the code cannot be transplanted to other SQL servers. In some cases, you can write the code that contains MySQL extensions, but still keep it portable by using "/… /"Comment out these extensions. In this example, the MySQL server can parse and execute the code in the comment, just like other MySQL statements, but other SQL servers will ignore these extensions. For example:
SELECT /! STRAIGHT_JOIN/col_name FROM table1, table2 WHERE...
If the character "!" The version number is added. the syntax in the comment is executed only when the MySQL version is equal to or higher than the specified version number:
CREATE /! 32302 TEMPORARY/TABLE t (a INT );
This means that if your version number is 3.23.02 or higher, the MySQL server will use the TEMPORARY keyword.