问题描述
1.nacos导入配置失败:未读取到合法的数据,请检查导入的数据文件
2.nacos添加配置报错: 发布失败。请检查参数是否正确
问题分析
这是nacos版本的问题,我使用的版本是nacos2.0.3。在nacos2.1.0以下的版本的MySQL数据库中的相应表是没有’encrypted_data_key’字段的。
检查自己的数据库发现:
config_info
config_info_beta
his_config_info
都存在`encrypted_data_key`这个字段
**
解决方案
**
删除三张表里面的字段
alter table config_info drop column `encrypted_data_key`;
alter table config_info_beta drop column `encrypted_data_key`;
alter table his_config_info drop column `encrypted_data_key`;
问题解决
总结:
nacos版本>2.1,数据库表要有encrypted_data_key这个字段
nacos版本<2.1,数据库表不能有encrypted_data_key这个字段