Taiwan
|
本帖最後由 thanatos 於 2023-04-09 17:00 編輯
The file install/data/common_district_4.sql contains two kinds of errors.
1. Accidentally putting the ALTER statement to the comment:
- -- 1) ADD THE LOCATION CODE FIELD
- -- ALTER TABLE `pre_common_district` ADD `code` VARCHAR( 64 ) NOT NULL;
Copy the Code The ALTER statement should be executed, or the later INSERT statements will result in errors due to the lack of field "code":
Initializing data in data table pre_common_template ... Success
Initializing data in data table pre_common_usergroup ... Success
Initializing data in data table pre_common_usergroup_field ... Success
Initializing data in data table pre_common_word_type ... Success
Initializing data in data table pre_forum_bbcode ... Success
Initializing data in data table pre_forum_forum ... Success
Initializing data in data table pre_forum_forumfield ... Success
Initializing data in data table pre_forum_grouplevel ... Success
Initializing data in data table pre_forum_imagetype ... Success
Initializing data in data table pre_forum_medal ... Success
Initializing data in data table pre_forum_onlinelist ... Success
Initializing data in data table pre_forum_typeoption ... Success
Initializing data in data table pre_home_click ... Success
Initializing data in data table pre_common_block_style ... Success
Initializing data in data table pre_common_admincp_group ... Success
Initializing data in data table pre_common_admincp_perm ... Success
Initializing data in data table pre_forum_threadprofile ... Success
Data installed successfully ...
Data installed successfullySuccess
Install regional data :
Initializing data in data table pre_common_district ... Success
Initializing data in data table pre_common_district ... Success
Initializing data in data table pre_common_district ... Success
Failed
Initializing data in data table INSERT INTO `pre_common_district`(`id`, `level`, `upid`, `usetype`, `code`, `name`) VALUES(48001, 2, 45120, 3, 'GG', 'Gagra'),(48002, 2, 45120, 3, 'GD', 'Gudauta'),(48003, 2, 45120, 3, 'SH', 'Sukhum'),(48004, 2, 45120, 3, 'GR', 'Gulripsh'),(48005, 2, 45120, 3, 'OC', 'Ochamchira'),(48006, 2, 45120, 3, 'TQ', 'Tquarchal'),(48007, 2, 45120, 3, 'GL', 'Gali') ... Failed
2. Comments shouldn't be present in VALUES clause
- (45230, 'AQ', 'Antarctica', 0, 0, 0, 1120),
- -- `code`='AR', `name`='Argentina', `displayorder`=1130 WHERE `id`=563;
- (45240, 'AS', 'American Samoa', 0, 0, 3, 1140),
- -- `code`='AT', `name`='Austria', `level`=0, `upid`=0, `usetype`=3, `displayorder`=1150 WHERE `id`=551;
- -- `code`='AU', `name`='Australia', `level`=0, `upid`=0, `usetype`=3, `displayorder`=1160 WHERE `id`=537;
- (45250, 'AW', 'Aruba', 0, 0, 3, 1170),
- (45260, 'AX', 'Aland Islands', 0, 0, 3, 1180),
- (45270, 'AZ', 'Azerbaijan', 0, 0, 3, 1190),
Copy the Code These comments cause SQL syntax error during the installation process:
Initializing data in data table pre_common_word_type ... Success
Initializing data in data table pre_forum_bbcode ... Success
Initializing data in data table pre_forum_forum ... Success
Initializing data in data table pre_forum_forumfield ... Success
Initializing data in data table pre_forum_grouplevel ... Success
Initializing data in data table pre_forum_imagetype ... Success
Initializing data in data table pre_forum_medal ... Success
Initializing data in data table pre_forum_onlinelist ... Success
Initializing data in data table pre_forum_typeoption ... Success
Initializing data in data table pre_home_click ... Success
Initializing data in data table pre_common_block_style ... Success
Initializing data in data table pre_common_admincp_group ... Success
Initializing data in data table pre_common_admincp_perm ... Success
Initializing data in data table pre_forum_threadprofile ... Success
Data installed successfully ...
Data installed successfullySuccess
Install regional data :
Initializing data in data table pre_common_district ... Success
Initializing data in data table pre_common_district ... Success
Initializing data in data table pre_common_district ... Success
Initializing data in data table INSERT INTO `pre_common_district`(`id`, `code`, `name`, `level`, `upid`, `usetype`, `displayorder`) VALUES(45100, 'A1', 'Anonymous Proxy', 0, 0, 0, 9999),(45110, 'A2', 'Satellite Provider', 0, 0, 0, 9999),(45120, 'AB', 'Abkhazia', 0, 0, 3, 1010),(45130, 'AD', 'Andorra', 0, 0, 3, 1020),(45140, 'AE', 'United Arab Emirates', 0, 0, 3, 1030),(45150, 'AF', 'Afghanistan', 0, 0, 3, 1040),(45160, 'AG', 'Antigua and Barbuda', 0, 0, 3, 1050),(45170, 'AI', 'Anguilla', 0, 0, 3, 1060),(45180, 'AL', 'Albania', 0, 0, 3, 1070),(45190, 'AM', 'Armenia', 0, 0, 3, 1080),(45200, 'AN', 'Netherlands Antilles', 0, 0, 3, 1090),(45210, 'AO', 'Angola', 0, 0, 3, 1100),(45220, 'AP', 'Asia/Pacific Region', 0, 0, 0, 1110),(45230, 'AQ', 'Antarctica', 0, 0, 0, 1120), ... Failed
The error could be fixed by removing those comments inner VALUES clause.
I'm using Percona 8.0.26.16 which is compatible with MySQL 8.0.26. I don't know if it works on other MySQL versions.
|
|