mysqltuner.pl
给我看结果
[!!] 2 different collations for database ccdb
COLLATE
我在数据库级别上没有看到两个不同。这可能吗?如何验证?
> show create database ccdb;
+----------+---------------------------------------------------------------------------------------+
| Database | Create Database |
+----------+---------------------------------------------------------------------------------------+
| ccdb | CREATE DATABASE `ccdb` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci */ |
+----------+---------------------------------------------------------------------------------------+
1 row in set (0.00 sec)
> select * from information_schema.schemata where schema_name = 'ccdb';
+--------------+-------------+----------------------------+------------------------+----------+
| CATALOG_NAME | SCHEMA_NAME | DEFAULT_CHARACTER_SET_NAME | DEFAULT_COLLATION_NAME | SQL_PATH |
+--------------+-------------+----------------------------+------------------------+----------+
| def | ccdb | utf8 | utf8_unicode_ci | NULL |
+--------------+-------------+----------------------------+------------------------+----------+
1 row in set (0.00 sec)
我看到了不同TABLE_COLLATION
。这是个问题吗?
> SELECT count(*), TABLE_COLLATION FROM information_schema.TABLES WHERE TABLE_SCHEMA='ccdb' group by TABLE_COLLATION;
+----------+-----------------+
| count(*) | TABLE_COLLATION |
+----------+-----------------+
| 29 | utf8_bin |
| 26 | utf8_general_ci |
+----------+-----------------+
2 rows in set (0.00 sec)
> select version();
+-----------------+
| version() |
+-----------------+
| 10.1.20-MariaDB |
+-----------------+
1 row in set (0.00 sec)
不,这不是问题。文档总结了一些事情。
如果在创建表时未指定相关子句,则默认数据库字符集/排序规则值将用于表。