nacos2.0.2升级2.2.1报错Column ‘ENCRYPTED_DATA_KEY‘ is either not in any table

最重要的一点,确认你用的数据库是mysql,而不是自带的Derby
主要看报错内容是不是包含:

Caused by: org.apache.derby.iapi.error.StandardException: Column 'ENCRYPTED_DATA_KEY' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then 'ENCRYPTED_DATA_KEY' is not a column in the target table.

以上报错表示nacos使用的数据库是默认内嵌的derby数据库,建议通过导出配置的方式进行升级

如果是使用mysql作为数据库的nacos,在数据库中执行以下sql即可解决报错

ALTER TABLE config_info ADD COLUMN `encrypted_data_key` text NOT NULL COMMENT 'secret key';
ALTER TABLE config_info_beta ADD COLUMN `encrypted_data_key` text NOT NULL COMMENT 'secret key';
ALTER TABLE his_config_info ADD COLUMN `encrypted_data_key` text NOT NULL COMMENT 'secret key';

你可能感兴趣的:(linux,nacos)