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 utf8 in all configuration files
  2. Reload mysqld daemon
  3. Drop database keystone 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 database keystone 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


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章