when I use CREATE TEMPORARY TABLE
to create a temporary table, the collation of this table is utf8_unicode_ci
by default. why by default it is utf8_unicode_ci
? How can I change the default?
Mysql – changing TEMPORARY TABLE default collation
collationMySQLmysql-5.5mysql-5.6temporary-tables
Related Question
- MySQL – Server collation utf8_unicode_ci vs table collation utf8_bin: compatibility and performance
- PostgreSQL – Setting a Default Collation for a Database
- SQL Server Collation – Default vs Database Collation Issues
- MariaDB Collation – Change Default Collation to utf8mb4_unicode_ci
- PostgreSQL Default Collation Not Working
- MySQL- Performance implications of changing a column collation from latin1_swedish_ci to latin1_bin
Best Answer
The CREATE TABLE syntax allows for specifying the character set and collation
The MySQL Documentation for CREATE TABLE shows this syntax:
Therefore, your syntax should be something like this:
Give it a Try !!!
If you want to manipulate the default options for collation, you have the following:
These variables can be changed at the Global or Session Level.
If you want to set the collation permamnently, you could put it in
/etc/my.cnf
and restart mysql
If you only want this for an individual BB Connection, you would run this in the session
See my recent post Why are there different levels of MySQL collation/charsets? to see installed character sets and collations.