keystone同步数据库的时候提示error

 

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'\nCREATE TABLE migrate_version (\n\trepository_id VARCHAR(250) NOT NULL, \n\trepository_path TEXT, \n\tversion INTEGER, \n\tPRIMARY KEY (repository_id)\n)\n\n']

解决方案:

修改:
#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数据库删掉,重新创建即可。

 

posted @ 2017-03-08 10:53  风来风往风伤(TiAmo)  阅读(1608)  评论(0编辑  收藏  举报