others linux服务器运维 django3 监控 k8s golang 数据库 大数据 前端 devops 理论基础 java oracle 运维日志

zabbix 迁移数据库 Unsupported charset or collation for tables:

访问量:1867 创建时间:2021-09-08

建议先备份数据库

##修改数据库编码
MariaDB [(none)]> ALTER DATABASE `zabbix` DEFAULT CHARACTER SET utf8 COLLATE utf8_bin;
##查看表编码
MariaDB [(none)]> SELECT CONCAT("ALTER TABLE ", TABLE_NAME," CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;") AS ExecuteTheString FROM information_schema.`COLUMNS` WHERE table_schema = "zabbix" AND COLLATION_NAME = "utf8_general_ci";
###执行alert语句
ALTER TABLE widget_field CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;               
ALTER TABLE widget CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                     
ALTER TABLE valuemaps CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                  
ALTER TABLE usrgrp CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                     
ALTER TABLE users CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                      
ALTER TABLE trigger_tag CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                
ALTER TABLE triggers CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                   
ALTER TABLE task_remote_command_result CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin; 
ALTER TABLE task_remote_command CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;        
ALTER TABLE tag_filter CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                 
ALTER TABLE sysmap_url CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                 
ALTER TABLE sysmaps_link_triggers CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;      
ALTER TABLE sysmaps_links CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;              
ALTER TABLE sysmap_shape CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;               
ALTER TABLE sysmaps_elements CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;           
ALTER TABLE sysmaps CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                    
ALTER TABLE sysmap_element_url CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;         
ALTER TABLE slideshows CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                 
ALTER TABLE slides CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                     
ALTER TABLE sessions CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                   
ALTER TABLE services_times CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;             
ALTER TABLE services CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                   
ALTER TABLE scripts CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                    
ALTER TABLE screens_items CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;              
ALTER TABLE screens CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                    
ALTER TABLE regexps CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                    
ALTER TABLE proxy_history CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;              
ALTER TABLE proxy_dhistory CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;             
ALTER TABLE proxy_autoreg_host CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;         
ALTER TABLE profiles CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                   
ALTER TABLE problem_tag CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                
ALTER TABLE problem CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                    
ALTER TABLE opmessage CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                  
ALTER TABLE operations CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                 
ALTER TABLE opconditions CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;               
ALTER TABLE opcommand CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                  
ALTER TABLE media_type CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                 
ALTER TABLE media CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                      
ALTER TABLE mappings CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                   
ALTER TABLE maintenance_tag CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;            
ALTER TABLE maintenances CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;               
ALTER TABLE items CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                      
ALTER TABLE item_preproc CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;               
ALTER TABLE item_discovery CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;             
ALTER TABLE item_condition CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;             
ALTER TABLE interface CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                  
ALTER TABLE images CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                     
ALTER TABLE ids CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                        
ALTER TABLE icon_mapping CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;               
ALTER TABLE icon_map CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                   
ALTER TABLE httptest_field CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;             
ALTER TABLE httptest CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                   
ALTER TABLE httpstep_field CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;             
ALTER TABLE httpstep CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                   
ALTER TABLE hstgrp CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                     
ALTER TABLE housekeeper CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                
ALTER TABLE hosts CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                      
ALTER TABLE hostmacro CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                  
ALTER TABLE host_inventory CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;             
ALTER TABLE host_discovery CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;             
ALTER TABLE history_text CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;               
ALTER TABLE history_str CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                
ALTER TABLE history_log CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                
ALTER TABLE group_prototype CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;            
ALTER TABLE group_discovery CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;            
ALTER TABLE graph_theme CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                
ALTER TABLE graphs_items CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;               
ALTER TABLE graphs CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                     
ALTER TABLE globalmacro CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                
ALTER TABLE functions CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                  
ALTER TABLE expressions CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                
ALTER TABLE event_tag CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                  
ALTER TABLE events CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                     
ALTER TABLE dservices CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                  
ALTER TABLE drules CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                     
ALTER TABLE dchecks CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                    
ALTER TABLE dashboard CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                  
ALTER TABLE correlation CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                
ALTER TABLE corr_condition_tagvalue CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;    
ALTER TABLE corr_condition_tagpair CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;     
ALTER TABLE corr_condition_tag CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;         
ALTER TABLE config CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                     
ALTER TABLE conditions CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                 
ALTER TABLE autoreg_host CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;               
ALTER TABLE auditlog_details CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;           
ALTER TABLE auditlog CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                   
ALTER TABLE applications CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;               
ALTER TABLE application_prototype CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;      
ALTER TABLE application_discovery CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;      
ALTER TABLE alerts CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                     
ALTER TABLE actions CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;                    
ALTER TABLE acknowledges CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;     
ALTER TABLE housekeeper CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
ALTER TABLE hstgrp CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
登陆评论: 使用GITHUB登陆