Expecting utf8mb4 charset on new table
Posted by: Jim Staff
Date: December 11, 2018 09:33AM

Hi,

I'm creating a new simple table where I don't specify a charset. I expect it to have utf8mb4, but it says utf8.

The server vars all point to utf8mb4

mysql> show global variables like '%char%';
+--------------------------+--------------------------------+
| Variable_name | Value |
+--------------------------+--------------------------------+
| character_set_client | utf8mb4 |
| character_set_connection | utf8mb4 |
| character_set_database | utf8mb4 |
| character_set_filesystem | binary |
| character_set_results | utf8mb4 |
| character_set_server | utf8mb4 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql-8.0/charsets/ |
+--------------------------+--------------------------------+


I create the new table from a text file via command line
(mysql ... < table_file.txt):

CREATE TABLE `zzzTest` (
`Count` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`Count`)
)

Then mysqldump it, it says that the default charset is utf8, not utf8mb4. Why?

DROP TABLE IF EXISTS `zzzTest`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
SET character_set_client = utf8mb4 ;
CREATE TABLE `zzzTest` (
`Count` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`Count`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Options: ReplyQuote


Subject
Views
Written By
Posted
Expecting utf8mb4 charset on new table
1740
December 11, 2018 09:33AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.