Simptome: în log apar erori de genul:
Unknown column 'kill_log' in 'field list'Table 'player.battle_pass' doesn't existTable 'player.growth_pet' doesn't exist
Cauză: schema bazei de date nu este aliniată cu serverul (lipsesc coloane/tabele în DB-ul folosit).
1) Verifică DB-ul corect și existența coloanelor/tabelelor
Conectează-te în MySQL:
mysql -u root -p
Apoi rulează:
SHOW DATABASES;
USE player;
SHOW COLUMNS FROM player LIKE 'kill_log';
SHOW TABLES LIKE 'battle_pass';
SHOW TABLES LIKE 'growth_pet';
Dacă nu găsești kill_log / battle_pass / growth_pet, urmează pașii de mai jos.
2) Fix rapid: adaugă ce lipsește (coloană + tabele)
2.1 Adaugă coloana kill_log în tabelul player
USE player;
ALTER TABLE `player`
ADD COLUMN `kill_log` TEXT NULL;
Notă: Dacă primești o eroare că există deja coloana, sari peste acest pas.
2.2 Creează tabelul battle_pass
USE player;
CREATE TABLE IF NOT EXISTS `battle_pass` (
`player_id` INT UNSIGNED NOT NULL,
`mission_id` INT UNSIGNED NOT NULL,
`battle_pass_id` INT UNSIGNED NOT NULL,
`extra_info` VARCHAR(255) NOT NULL DEFAULT '',
`completed` TINYINT UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`player_id`, `battle_pass_id`, `mission_id`),
KEY `idx_player` (`player_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
2.3 Creează tabelul growth_pet
USE player;
CREATE TABLE IF NOT EXISTS `growth_pet` (
`id` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`owner_id` INT UNSIGNED NOT NULL,
`vnum` INT UNSIGNED NOT NULL DEFAULT 0,
`state` TINYINT UNSIGNED NOT NULL DEFAULT 0,
`name` VARCHAR(64) NOT NULL DEFAULT '',
`size` TINYINT UNSIGNED NOT NULL DEFAULT 0,
`level` SMALLINT UNSIGNED NOT NULL DEFAULT 1,
`level_step` INT UNSIGNED NOT NULL DEFAULT 0,
`evolution` TINYINT UNSIGNED NOT NULL DEFAULT 0,
`type` TINYINT UNSIGNED NOT NULL DEFAULT 0,
`hp` INT UNSIGNED NOT NULL DEFAULT 0,
`sp` INT UNSIGNED NOT NULL DEFAULT 0,
`def` INT UNSIGNED NOT NULL DEFAULT 0,
`hp_apply` INT UNSIGNED NOT NULL DEFAULT 0,
`sp_apply` INT UNSIGNED NOT NULL DEFAULT 0,
`def_apply` INT UNSIGNED NOT NULL DEFAULT 0,
`age_apply` INT UNSIGNED NOT NULL DEFAULT 0,
`skill_level` TINYINT UNSIGNED NOT NULL DEFAULT 0,
`exp` BIGINT UNSIGNED NOT NULL DEFAULT 0,
`item_exp` BIGINT UNSIGNED NOT NULL DEFAULT 0,
`birthday` INT UNSIGNED NOT NULL DEFAULT 0,
`end_time` INT UNSIGNED NOT NULL DEFAULT 0,
`max_time` INT UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
KEY `idx_owner_state` (`owner_id`, `state`),
KEY `idx_owner` (`owner_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
3) Verificare finală + restart servicii
Confirmă că există acum:
USE player;
SHOW COLUMNS FROM `player` LIKE 'kill_log';
SHOW TABLES LIKE 'battle_pass';
SHOW TABLES LIKE 'growth_pet';
Apoi repornește componentele serverului (game/core/db) și verifică logurile.
4) Troubleshooting
- Dacă apare alt
Unknown columnsau alt tabel lipsă: schema DB încă nu corespunde serverfiles. Importă toate update-urile SQL. - Asigură-te că aplicația folosește același DB pe care rulezi comenzi (
USE player;). - Dacă ai mai multe instanțe MySQL / porturi, verifică host/user/parola din config.