keystone 在同步的时候报出以下错误:
su -s /bin/sh -c "keystone-manage db_sync" keystone
CRITICAL keystone [-] DBError: (pymysql.err.InternalError) (1071, u'Specified key was too long; max key length is 767 bytes') [SQL: u' CREATE TABLE migrate_version ( repository_id VARCHAR(250) NOT NULL, repository_path TEXT, version INTEGER, PRIMARY KEY (repository_id) ) ']
解决方案:
修改:
#cd /etc/mysql/mariadb.conf.d
修改下面每个文件中的字符集为utf8mb4 -> utf8,然后重启mysql,登陆mysql查询数据库默认字符集:
MariaDB [(none)]> show variables like "%char%";
+--------------------------+----------------------------+
| Variable_name | Value |
+--------------------------+----------------------------+
| character_set_client | utf8 |
| character_set_connection | utf8 |
| character_set_database | utf8 |
| character_set_filesystem | binary |
| character_set_results | utf8 |
| character_set_server | utf8 |
| character_set_system | utf8 |
| character_sets_dir | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
将keystone数据库删掉,重新创建即可。