首页 > 数据库 > MySQL > mysql字符集--utf8mb4
|
对于mysql来说,在中国,我们通常选择的有utf8和gbk,但是在MySQL5.5版本之后,开始支持utf8mb4字符集,这里就浅析一下utf8和utf8mb4的区别。 首先说一下utf8mb4是utf8的一个超集,它完全兼容utf8字符集。以往mysql里面的utf8字符集的一个字符最多只有3个字节,只支持bmp这部分的unicode编码区,而utf8mb4则扩展到一个字符最多能够有4个字节,所以能够支持更多的字符集。 |
|
[client] default-character-set=utf8mb4 [mysqld] character-set-server=utf8mb4 |
|
InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy and Percona LLC and/or its affiliates 2009-2013. All Rights Reserved. This software is published under the GNU GENERAL PUBLIC LICENSE Version 2, June 1991. Get the latest version of Percona XtraBackup, documentation, and help resources: http://www.percona.com/xb/p 150915 15:30:25 innobackupex: Executing a version check against the server... 150915 15:30:25 innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_file=/etc/my.cnf;mysql_read_default_group=xtrabackup' as 'root' (using password: YES). Character set 'utf8mb4' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file innobackupex: got a fatal error with the following stacktrace: at /usr/bin/innobackupex line 3011 main::mysql_connect('abort_on_error', 1) called at /usr/bin/innobackupex line 1551 innobackupex: Error: Failed to connect to MySQL server: DBI connect(';mysql_read_default_file=/etc/my.cnf;mysql_read_default_group=xtrabackup','root',...) failed: Can't initialize character set utf8mb4 (path: /usr/share/mysql/charsets/) at /usr/bin/innobackupex line 2995 150915 15:30:25 innobackupex: Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_file=/etc/my.cnf;mysql_read_default_group=xtrabackup' as 'root' (using password: YES). Character set 'utf8mb4' is not a compiled character set and is not specified in the '/usr/share/mysql/charsets/Index.xml' file innobackupex: got a fatal error with the following stacktrace: at /usr/bin/innobackupex line 3011 main::mysql_connect('abort_on_error', 1) called at /usr/bin/innobackupex line 1570 innobackupex: Error: Failed to connect to MySQL server: DBI connect(';mysql_read_default_file=/etc/my.cnf;mysql_read_default_group=xtrabackup','root',...) failed: Can't initialize character set utf8mb4 (path: /usr/share/mysql/charsets/) at /usr/bin/innobackupex line 2995 |
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/30150152/viewspace-1800526/ ,如需转载,请注明出处,否则将追究法律责任。