When installing/updating AzerothCore sometimes one encounters errors such as:
[ERROR]: In mysql_stmt_prepare() id: 3, sql:
[ERROR]: Unknown column 'entry' in 'field list'
[ERROR]: Unknown column 'dmg_multiplier' in 'field list'
this usually means the database structure is not up to date.
More specifically, the local DB version is not aligned with the local core version.
This leads to the following questions:
- How to check whether the DB is up to date or not?
- How to understand what DB SQL updates are missing per each DB?
AzerothCore has three databases: auth, characters and world. All of them need to be properly up to date in order to start the server application.
Each database has a table version_db_xxxx
which holds information about the database version inside its last column's name.
- auth DB has the
version_db_auth
table - characters DB has the
version_db_characters
table - world DB has the
version_db_world
table
The database version will be expressed in the format of YYYY_MM_DD_XX
which is basically a date followed by a number (XX
).
This value will be the name of the last column of such tables and it corresponds to the name of the last SQL update file that has been applied to that database.
The SQL update files can be found in the azerothcore-wotlk/data/sql/updates/db_xxxx/
directory (where xxx
is the database name):
https://github.com/azerothcore/azerothcore-wotlk/tree/master/data/sql/updates/db_auth
https://github.com/azerothcore/azerothcore-wotlk/tree/master/data/sql/updates/db_characters
https://github.com/azerothcore/azerothcore-wotlk/tree/master/data/sql/updates/db_world
To make sure the database is up to date, one should compare (per each database):
- the last column name of the
version_db_xxxx
table - the most recent sql file name contained in
data/sql/updates/db_xxxx
(most recent in terms of most recent date. If the date is the same, the file having the highest pending number is the most recent)
If the values are the same, then the DB is up to date. Otherwise, the DB needs to be updated by importing all missing SQL update files in order.
来源:https://stackoverflow.com/questions/55282167/how-to-make-sure-that-the-db-is-up-to-date