OpenStack Error – Index column size too large. The maximum column size is 767 bytes [Solved]

文章原地址 https://techglimpse.com/openstack-db-sync-error-mysql-character-set-solution/


执行

# 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']


Overall,you need to perform below steps:

  1. Replace utf8mb4 to utf8in all configuration files
  2. ReloadMysqLddaemon
  3. Drop databasekeystone or glance or nova or neutron(for whichever service you were getting error and don’t worry,you haven’t populated the database yet and it’s safe to remove)
  4. Create databasekeystone or glance or nova or neutron
  5. Try db_sync or populate the database using OpenStack commands. It should probably work,else try Fix 2.
解决方案:

1.将/etc/MysqL/mariadb.conf.d目录下的所有.cnf文件中出现uft8mb4的地方都修改成uft8

2.重启数据库 service MysqL restart

3.进入数据库把建立的keystone数据库删除

4.重新建立keystone数据库

5.输入su -s /bin/sh -c "keystone-manage db_sync" keystone 应该就可以运行了,不行的话实时Fix2.




同时推荐文章http://blog.csdn.net/zhujie_hades/article/details/52104116

相关文章

目录前言一、创建Hadoop用户二、更新apt和安装Vim编辑器三、...
原文连接:https://www.cnblogs.com/yasmi/p/5192694.html ...
电脑重启后,打开VirtualBox,发现一直用的虚拟机莫名的消失...
参见:https://blog.csdn.net/weixin_38883338/article/deta...
Ubuntu 18.04 LTS 已切换到 Netplan 来配置网络接口。Netpla...
介绍每个 Web 服务都可以通过特定的 URL 在 Internet 上访问...