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数据库删掉,重新创建即可。
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
作者:风来风往风伤
出处:http://www.cnblogs.com/amwuau/
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文链接,否则保留追究法律责任的权利。