Today I try “Database Migration Toolkit” from dbsoft.com and db migration is ok. There is a 3 error but I fix it.
Getting ‘alert_instance’ table structure …
Creating table ‘alert_instance’ …
Create table ‘alert_instance’ failed!
Code: 1170, Msg: ERROR 1170: BLOB/TEXT column ‘rule_uid’ used in key specification without a key
length
CREATE TABLE alert_instance
(rule_org_id
INT NOT NULL AUTO_INCREMENT COMMENT
‘TRIAL’,
rule_uid
LONGTEXT NOT NULL COMMENT ‘TRIAL’,
labels
LONGTEXT NOT NULL COMMENT ‘TRIAL’,
labels_hash
LONGTEXT NOT NULL COMMENT ‘TRIAL’,
current_state
LONGTEXT NOT NULL COMMENT ‘TRIAL’,
current_state_since
INT NOT NULL COMMENT ‘TRIAL’,
last_eval_time
INT NOT NULL COMMENT ‘TRIAL’,
current_state_end
INT NOT NULL DEFAULT 0 COMMENT ‘TRIAL’,
trial831
CHAR(1) COMMENT ‘TRIAL’,
PRIMARY KEY(rule_org_id
,rule_uid
,labels_hash
)) ENGINE=InnoDB COMMENT=‘TRIAL’
Getting ‘cache_data’ table structure …
Creating table ‘cache_data’ …
Create table ‘cache_data’ failed!
Code: 1170, Msg: ERROR 1170: BLOB/TEXT column ‘cache_key’ used in key specification without a
key length
CREATE TABLE cache_data
(cache_key
LONGTEXT NOT NULL COMMENT ‘TRIAL’,
data
LONGBLOB NOT NULL COMMENT ‘TRIAL’,
expires
INT NOT NULL COMMENT ‘TRIAL’,
created_at
INT NOT NULL COMMENT ‘TRIAL’,
trial844
CHAR(1) COMMENT ‘TRIAL’,
PRIMARY KEY(cache_key
)) ENGINE=InnoDB COMMENT=‘TRIAL’
Getting ‘session’ table structure …
Creating table ‘session’ …
Create table ‘session’ failed!
Code: 1170, Msg: ERROR 1170: BLOB/TEXT column ‘key’ used in key specification without a key
length
CREATE TABLE session
(key
LONGTEXT NOT NULL COMMENT ‘TRIAL’,
data
LONGBLOB NOT NULL COMMENT ‘TRIAL’,
expiry
INT NOT NULL COMMENT ‘TRIAL’,
trial890
CHAR(1) COMMENT ‘TRIAL’,
PRIMARY KEY(key
)) ENGINE=InnoDB COMMENT=‘TRIAL’
I change SQL command to this
CREATE TABLE alert_instance
(
rule_org_id
INT NOT NULL AUTO_INCREMENT,
rule_uid
VARCHAR(255) NOT NULL,
labels
VARCHAR(255) NOT NULL,
labels_hash
VARCHAR(255) NOT NULL ,
current_state
VARCHAR(255) NOT NULL,
current_state_since
INT NOT NULL,
last_eval_time
INT NOT NULL,
current_state_end
INT NOT NULL DEFAULT 0,
trial831
CHAR(1),
PRIMARY KEY(rule_org_id
,rule_uid
,labels_hash
)) ENGINE=InnoDB;
CREATE TABLE cache_data
(
cache_key
VARCHAR(255) NOT NULL,
data
LONGBLOB NOT NULL,
expires
INT NOT NULL,
created_at
INT NOT NULL,
trial844
CHAR(1),
PRIMARY KEY(cache_key
)) ENGINE=InnoDB;
CREATE TABLE session
(
key
VARCHAR(255) NOT NULL,
data
LONGBLOB NOT NULL,
expiry
INT NOT NULL,
trial890
CHAR(1),
PRIMARY KEY(key
)) ENGINE=InnoDB;
Database is ok but I still see this error in grafana logs.
t=2021-08-11T08:35:32+0000 lvl=crit msg=“alert migration failure: could not get migration log” logger=migrator error=“failed to check table existence: Error 1045: Access denied for user ‘xx’@‘xx’ (using password: YES)”
Any idea?