db migrate script to set charset=utf8 for all tables
来源:互联网 发布:淘宝做任务赚钱 编辑:程序博客网 时间:2024/06/11 02:14
Error:
root@controller:/etc/keystone/scripts# glance-manage db_sync
2014-10-20 10:18:39.149 19807 CRITICAL glance [-] ValueError: Tables "migrate_version" have non utf8 collation, please make sure all tables are CHARSET=utf8
2014-10-20 10:18:39.149 19807 TRACE glance Traceback (most recent call last):
2014-10-20 10:18:39.149 19807 TRACE glance File "/usr/bin/glance-manage", line 10, in <module>
2014-10-20 10:18:39.149 19807 TRACE glance sys.exit(main())
2014-10-20 10:18:39.149 19807 TRACE glance File "/usr/lib/python2.7/dist-packages/glance/cmd/manage.py", line 259, in main
2014-10-20 10:18:39.149 19807 TRACE glance return CONF.command.action_fn()
2014-10-20 10:18:39.149 19807 TRACE glance File "/usr/lib/python2.7/dist-packages/glance/cmd/manage.py", line 160, in sync
2014-10-20 10:18:39.149 19807 TRACE glance CONF.command.current_version)
2014-10-20 10:18:39.149 19807 TRACE glance File "/usr/lib/python2.7/dist-packages/glance/cmd/manage.py", line 137, in sync
2014-10-20 10:18:39.149 19807 TRACE glance sanity_check=self._need_sanity_check())
2014-10-20 10:18:39.149 19807 TRACE glance File "/usr/lib/python2.7/dist-packages/glance/openstack/common/db/sqlalchemy/migration.py", line 195, in db_sync
2014-10-20 10:18:39.149 19807 TRACE glance _db_schema_sanity_check(engine)
2014-10-20 10:18:39.149 19807 TRACE glance File "/usr/lib/python2.7/dist-packages/glance/openstack/common/db/sqlalchemy/migration.py", line 221, in _db_schema_sanity_check
2014-10-20 10:18:39.149 19807 TRACE glance ) % ','.join(table_names))
2014-10-20 10:18:39.149 19807 TRACE glance ValueError: Tables "migrate_version" have non utf8 collation, please make sure all tables are CHARSET=utf8
2014-10-20 10:18:39.149 19807 TRACE glance
Solutions:
edit /etc/mysql/my.conf, add 3 lines in [mysqlid]section:
collation-server = utf8_general_ci
init-connect='SET NAMES utf8'
character-set-server = utf8
then login glance database in mysql, change table charset:
mysql> alter table migrate_version convert to character set 'utf8';
OK, that's ok!
Reference: https://bugs.launchpad.net/glance/+bug/1279000
- db migrate script to set charset=utf8 for all tables
- SQL Server script to rebuild all indexes for all tables and all databases
- dbupgdiag.sql—Script to Collect DB Upgrade/Migrate Diagnostic Information
- Get all tables list form current DB.
- Migrations are pending. To resolve this issue, run: bin/rake db:migrate RAILS_ENV=development
- set mysql to utf8 encoding
- check if filed exists in all tables in current DB
- Script to compile invalid objects in DB
- migrate automated deployment script
- sqlalchemy db migrate
- nodejs db migrate入门
- SET character_set_connection=utf8
- right syntax to use near 'USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8' at line 6
- rake db:migrate RAILS_ENV=production 发生error
- How To List All The Named Events Set For A Database
- How To List All The Named Events Set For A Database [ID 436036.1]
- Migrate to Android Plugin for Gradle 3.0.0
- How to Generate Hibernate Pojo Classes from DB Tables
- Creating Apps With Material Design —— Defining Shadows and Clipping Views
- 独立开发者在创业过程中经常会犯的14个错误
- 关于页面传值汉字乱码的修正方法
- yuv视频用opengl播放
- 简单工厂模式
- db migrate script to set charset=utf8 for all tables
- VS旗舰版产品秘钥
- 转载--大型网站系统架构演化之路
- 方法中引用静态类方法时发生的悲剧
- 设置Oracle PL/SQL时间显示格式NLS_TIMESTAMP_FORMAT
- 服务器出现无法启动服务的问题
- 肚皮舞真的可以减肥吗?
- 增加桶式的动态哈希
- 数组的最大子数组积 Maximum Product Subarray