/*!40100 DEFAULT CHARACTER SET latin1 */
Why is it between comment marks?
What is the 40100 all about?
What is the ! for?
What does it do?
Where is the documentation for this?
The default MySQL server character set and collation are latin1 and latin1_swedish_ci , but you can specify character sets at the server, database, table, column, and string literal levels.
The MySQL latin1 character set is such a one-byte character set for Western Europe, and it is the default character set of MySQL up to and including 5.7. In spite of the name, the character set is actually Windows-1252 compliant, which is a superset of ISO-8859-1, also known as Latin-1.
The MySQL server has a compiled-in default character set and collation. To change these defaults, use the --character-set-server and --collation-server options when you start the server.
To change the character set encoding to UTF-8 for the database itself, type the following command at the mysql> prompt. Replace dbname with the database name: Copy ALTER DATABASE dbname CHARACTER SET utf8 COLLATE utf8_general_ci; To exit the mysql program, type \q at the mysql> prompt.
It's a conditional comment that can be interpreted by MySQL
The code 40100 means only these versions of MySQL>=4.1.0 (4.01.00) will interpret the conditional comment.
The !
is here to force MySQL to parse the code between the /* ... */
It sets the value of the parameter DEFAULT CHARACTER = 'latin1' so that the data in an SQL dump can be intepreted correctly during import. It doesn't affect the database structure, but merely helps the export/import process to work right.
http://dev.mysql.com/doc/refman/4.1/en/comments.html
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