[MediaWiki-l] UTF-8 and Error: 1064 ... syntax to use near '-8' at line 9

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[MediaWiki-l] UTF-8 and Error: 1064 ... syntax to use near '-8' at line 9

Jeffrey Walton
We are working on CentOS 7 x86_64 fully patched. We have SCL enabled
so Apache 2.4.58, PHP 7.1.8 and MariaDB 5.5.56 are being used.

We are trying to upgrade from MediaWiki 1.26 to 1.30. We are following
https://www.mediawiki.org/wiki/Manual:Upgrading. We have been catching
database errors so we are trying to run update.php per
https://www.mediawiki.org/wiki/Topic:U26n1a1pgo0078tt (the update.php
step is missing from Manual:Upgrading, so we did not run it first).

The update is failing due to a syntax error. The "-8" below appears to
be related to literal UTF-8. We are not sure how to proceed.

We also noticed a message "Database.php: A database query error has
occurred. Did you forget to run your application's database schema
updater after upgrading?". A database schema updater is not discussed
at Manual:Upgrading, so we are not sure what to do.

We found https://stackoverflow.com/questions/35631265/mysql-error-1064-default-character-set-utf8
, but the answer does not provide enough details for us to take
action.

Any help in getting our wiki back online would be greatly appreciated.

**************************************************

[root@ftpit maintenance]# pwd
/var/www/html/w/maintenance

[root@ftpit maintenance]# php ./update.php
PHP Notice:  Undefined index: SERVER_NAME in
/var/www/html/w/includes/GlobalFunctions.php on line 1507
PHP Notice:  Undefined index: SERVER_NAME in
/var/www/html/w/includes/GlobalFunctions.php on line 1507
MediaWiki 1.30.0 Updater

Your composer.lock file is up to date with current dependencies!
Going to run database updates for my_wiki-wikicryptopp_
Depending on the size of your database this may take a while!
Abort with control-c in the next five seconds (skip this countdown
with --quick) ... 0
Turning off Content Handler DB fields for this part of upgrade.
...have ipb_id field in ipblocks table.
...have ipb_expiry field in ipblocks table.
...already have interwiki table
...indexes seem up to 20031107 standards.
...have rc_type field in recentchanges table.
...index new_name_timestamp already set on recentchanges table.
...have user_real_name field in user table.
...querycache table already exists.
...objectcache table already exists.
...categorylinks table already exists.
...have pagelinks; skipping old links table updates
...il_from OK
...have rc_ip field in recentchanges table.
...index PRIMARY already set on image table.
...have rc_id field in recentchanges table.
...have rc_patrolled field in recentchanges table.
...logging table already exists.
...have user_token field in user table.
...have wl_notificationtimestamp field in watchlist table.
...watchlist talk page rows already present.
...user table does not contain user_emailauthenticationtimestamp field.
...page table already exists.
...have log_params field in logging table.
...logging table has correct log_title encoding.
...have ar_rev_id field in archive table.
...have page_len field in page table.
...revision table does not contain inverse_timestamp field.
...have rev_text_id field in revision table.
...have rev_deleted field in revision table.
...have img_width field in image table.
...have img_metadata field in image table.
...have user_email_token field in user table.
...have ar_text_id field in archive table.
...page_namespace is already a full int (int(11)).
...ar_namespace is already a full int (int(11)).
...rc_namespace is already a full int (int(11)).
...wl_namespace is already a full int (int(11)).
...qc_namespace is already a full int (int(11)).
...log_namespace is already a full int (int(11)).
...have img_media_type field in image table.
...already have pagelinks table.
...image table does not contain img_type field.
...already have unique user_name index.
...user_groups table exists and is in current format.
...have ss_total_pages field in site_stats table.
...user_newtalk table already exists.
...transcache table already exists.
...have iw_trans field in interwiki table.
...wl_notificationtimestamp is already nullable.
...index times already set on logging table.
...have ipb_range_start field in ipblocks table.
...no page_random rows needed to be set
...have user_registration field in user table.
...templatelinks table already exists
...externallinks table already exists.
...job table already exists.
...have ss_images field in site_stats table.
...langlinks table already exists.
...querycache_info table already exists.
...filearchive table already exists.
...have ipb_anon_only field in ipblocks table.
...index rc_ns_usertext already set on recentchanges table.
...index rc_user_text already set on recentchanges table.
...have user_newpass_time field in user table.
...redirect table already exists.
...querycachetwo table already exists.
...have ipb_enable_autoblock field in ipblocks table.
...index pl_namespace on table pagelinks includes field pl_from.
...index tl_namespace on table templatelinks includes field tl_from.
...index il_to on table imagelinks includes field il_from.
...have rc_old_len field in recentchanges table.
...have user_editcount field in user table.
...page_restrictions table already exists.
...have log_id field in logging table.
...have rev_parent_id field in revision table.
...have pr_id field in page_restrictions table.
...have rev_len field in revision table.
...have rc_deleted field in recentchanges table.
...have log_deleted field in logging table.
...have ar_deleted field in archive table.
...have ipb_deleted field in ipblocks table.
...have fa_deleted field in filearchive table.
...have ar_len field in archive table.
...have ipb_block_email field in ipblocks table.
...index cl_sortkey on table categorylinks includes field cl_from.
...have oi_metadata field in oldimage table.
...index usertext_timestamp already set on archive table.
...index img_usertext_timestamp already set on image table.
...index oi_usertext_timestamp already set on oldimage table.
...have ar_page_id field in archive table.
...have img_sha1 field in image table.
...protected_titles table already exists.
...have ipb_by_text field in ipblocks table.
...page_props table already exists.
...updatelog table already exists.
...category table already exists.
...category table already populated.
...have ar_parent_id field in archive table.
...have user_last_timestamp field in user_newtalk table.
...protected_titles table has correct pt_title encoding.
...have ss_active_users field in site_stats table.
...ss_active_users user count set...
...have ipb_allow_usertalk field in ipblocks table.
...change_tag table already exists.
...tag_summary table already exists.
...valid_tag table already exists.
...user_properties table already exists.
...log_search table already exists.
...have log_user_text field in logging table.
...l10n_cache table already exists.
...index change_tag_rc_tag already set on change_tag table.
...have rd_interwiki field in redirect table.
...transcache tc_time already converted.
...*_mime_minor fields are already long enough.
...iwlinks table already exists.
...index iwl_prefix_title_from already set on iwlinks table.
...have ul_value field in updatelog table.
...have iw_api field in interwiki table.
...iwl_prefix key doesn't exist.
...have cl_collation field in categorylinks table.
...categorylinks up-to-date.
...module_deps table already exists.
...ar_page_revid key doesn't exist.
...index ar_revid already set on archive table.
...ll_lang is up-to-date.
...user_last_timestamp is already nullable.
...index user_email already set on user table.
...up_property in table user_properties already modified by patch
patch-up_property.sql.
...uploadstash table already exists.
...user_former_groups table already exists.
...index type_action already set on logging table.
...have rev_sha1 field in revision table.
...batch conversion of user_options: nothing to migrate. done.
...user table does not contain user_options field.
...have ar_sha1 field in archive table.
...index page_redirect_namespace_len already set on page table.
...have us_chunk_inx field in uploadstash table.
...have job_timestamp field in job table.
...index page_user_timestamp already set on revision table.
...have ipb_parent_block_id field in ipblocks table.
...index ipb_parent_block_id already set on ipblocks table.
...category table does not contain cat_hidden field.
...have rev_content_format field in revision table.
...have rev_content_model field in revision table.
...have ar_content_format field in archive table.
...have ar_content_model field in archive table.
...have page_content_model field in page table.
Content Handler DB fields should be usable now.
...site_stats table does not contain ss_admins field.
...recentchanges table does not contain rc_moved_to_title field.
...sites table already exists.
...have fa_sha1 field in filearchive table.
...have job_token field in job table.
...have job_attempts field in job table.
...have us_props field in uploadstash table.
...ug_group in table user_groups already modified by patch
patch-ug_group-length-increase-255.sql.
...ufg_group in table user_former_groups already modified by patch
patch-ufg_group-length-increase-255.sql.
...index pp_propname_page already set on page_props table.
...index img_media_mime already set on image table.
...iwl_prefix_title_from index is already non-UNIQUE.
...index iwl_prefix_from_title already set on iwlinks table.
...have ar_id field in archive table.
...have el_id field in externallinks table.
...have rc_source field in recentchanges table.
...index log_user_text_type_time already set on logging table.
...index log_user_text_time already set on logging table.
...have page_links_updated field in page table.
...have user_password_expires field in user table.
...have pp_sortkey field in page_props table.
...recentchanges table does not contain rc_cur_time field.
...index wl_user_notificationtimestamp already set on watchlist table.
...have page_lang field in page table.
...have pl_from_namespace field in pagelinks table.
...have tl_from_namespace field in templatelinks table.
...have il_from_namespace field in imagelinks table.
...img_major_mime in table image already modified by patch
patch-img_major_mime-chemical.sql.
...oi_major_mime in table oldimage already modified by patch
patch-oi_major_mime-chemical.sql.
...fa_major_mime in table filearchive already modified by patch
patch-fa_major_mime-chemical.sql.
...comment fields are up to date...hitcounter doesn't exist.
...site_stats table does not contain ss_total_views field.
...page table does not contain page_counter field.
...msg_resource_links doesn't exist.
...msg_resource doesn't exist.
Creating bot_passwords table ...[a5a960b4f68493413603554e] [no req]
Wikimedia\Rdbms\DBQueryError from line 1149 of
/var/www/html/w/includes/libs/rdbms/database/Database.php: A database
query error has occurred. Did you forget to run your application's
database schema updater after upgrading?
Query: CREATE TABLE `wikicryptopp_bot_passwords` (
 bp_user int NOT NULL,
 bp_app_id varbinary(32) NOT NULL,
 bp_password tinyblob NOT NULL,
 bp_token binary(32) NOT NULL default '',
 bp_restrictions blob NOT NULL,
 bp_grants blob NOT NULL,
 PRIMARY KEY ( bp_user, bp_app_id )
 ) utf-8

Function: Wikimedia\Rdbms\Database::sourceFile(
/var/www/html/w/maintenance/archives/patch-bot_passwords.sql )
Error: 1064 You have an error in your SQL syntax; check the manual
that corresponds to your MariaDB server version for the right syntax
to use near '-8' at line 9 (localhost)

Backtrace:
#0 /var/www/html/w/includes/libs/rdbms/database/Database.php(979):
Wikimedia\Rdbms\Database->reportQueryError(string, integer, string,
string, boolean)
#1 /var/www/html/w/includes/libs/rdbms/database/Database.php(3325):
Wikimedia\Rdbms\Database->query(string, string)
#2 /var/www/html/w/includes/libs/rdbms/database/Database.php(3274):
Wikimedia\Rdbms\Database->sourceStream(unknown type, NULL, NULL,
string, NULL)
#3 /var/www/html/w/includes/installer/DatabaseUpdater.php(673):
Wikimedia\Rdbms\Database->sourceFile(string)
#4 /var/www/html/w/includes/installer/DatabaseUpdater.php(716):
DatabaseUpdater->applyPatch(string, boolean, string)
#5 /var/www/html/w/includes/installer/DatabaseUpdater.php(472):
DatabaseUpdater->addTable(string, string)
#6 /var/www/html/w/includes/installer/DatabaseUpdater.php(436):
DatabaseUpdater->runUpdates(array, boolean)
#7 /var/www/html/w/maintenance/update.php(204):
DatabaseUpdater->doUpdates(array)
#8 /var/www/html/w/maintenance/doMaintenance.php(92): UpdateMediaWiki->execute()
#9 /var/www/html/w/maintenance/update.php(249): require_once(string)
#10 {main}
[root@ftpit maintenance]#

_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: UTF-8 and Error: 1064 ... syntax to use near '-8' at line 9

Brian Wolff
Well first of all, running update.php definitely is mentioned at
https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script

The error sounds like you have $wgDBTableOptions set incorrectly.

--
bawolff

On Thursday, December 21, 2017, Jeffrey Walton <[hidden email]> wrote:

> We are working on CentOS 7 x86_64 fully patched. We have SCL enabled
> so Apache 2.4.58, PHP 7.1.8 and MariaDB 5.5.56 are being used.
>
> We are trying to upgrade from MediaWiki 1.26 to 1.30. We are following
> https://www.mediawiki.org/wiki/Manual:Upgrading. We have been catching
> database errors so we are trying to run update.php per
> https://www.mediawiki.org/wiki/Topic:U26n1a1pgo0078tt (the update.php
> step is missing from Manual:Upgrading, so we did not run it first).
>
> The update is failing due to a syntax error. The "-8" below appears to
> be related to literal UTF-8. We are not sure how to proceed.
>
> We also noticed a message "Database.php: A database query error has
> occurred. Did you forget to run your application's database schema
> updater after upgrading?". A database schema updater is not discussed
> at Manual:Upgrading, so we are not sure what to do.
>
> We found
https://stackoverflow.com/questions/35631265/mysql-error-1064-default-character-set-utf8

> , but the answer does not provide enough details for us to take
> action.
>
> Any help in getting our wiki back online would be greatly appreciated.
>
> **************************************************
>
> [root@ftpit maintenance]# pwd
> /var/www/html/w/maintenance
>
> [root@ftpit maintenance]# php ./update.php
> PHP Notice:  Undefined index: SERVER_NAME in
> /var/www/html/w/includes/GlobalFunctions.php on line 1507
> PHP Notice:  Undefined index: SERVER_NAME in
> /var/www/html/w/includes/GlobalFunctions.php on line 1507
> MediaWiki 1.30.0 Updater
>
> Your composer.lock file is up to date with current dependencies!
> Going to run database updates for my_wiki-wikicryptopp_
> Depending on the size of your database this may take a while!
> Abort with control-c in the next five seconds (skip this countdown
> with --quick) ... 0
> Turning off Content Handler DB fields for this part of upgrade.
> ...have ipb_id field in ipblocks table.
> ...have ipb_expiry field in ipblocks table.
> ...already have interwiki table
> ...indexes seem up to 20031107 standards.
> ...have rc_type field in recentchanges table.
> ...index new_name_timestamp already set on recentchanges table.
> ...have user_real_name field in user table.
> ...querycache table already exists.
> ...objectcache table already exists.
> ...categorylinks table already exists.
> ...have pagelinks; skipping old links table updates
> ...il_from OK
> ...have rc_ip field in recentchanges table.
> ...index PRIMARY already set on image table.
> ...have rc_id field in recentchanges table.
> ...have rc_patrolled field in recentchanges table.
> ...logging table already exists.
> ...have user_token field in user table.
> ...have wl_notificationtimestamp field in watchlist table.
> ...watchlist talk page rows already present.
> ...user table does not contain user_emailauthenticationtimestamp field.
> ...page table already exists.
> ...have log_params field in logging table.
> ...logging table has correct log_title encoding.
> ...have ar_rev_id field in archive table.
> ...have page_len field in page table.
> ...revision table does not contain inverse_timestamp field.
> ...have rev_text_id field in revision table.
> ...have rev_deleted field in revision table.
> ...have img_width field in image table.
> ...have img_metadata field in image table.
> ...have user_email_token field in user table.
> ...have ar_text_id field in archive table.
> ...page_namespace is already a full int (int(11)).
> ...ar_namespace is already a full int (int(11)).
> ...rc_namespace is already a full int (int(11)).
> ...wl_namespace is already a full int (int(11)).
> ...qc_namespace is already a full int (int(11)).
> ...log_namespace is already a full int (int(11)).
> ...have img_media_type field in image table.
> ...already have pagelinks table.
> ...image table does not contain img_type field.
> ...already have unique user_name index.
> ...user_groups table exists and is in current format.
> ...have ss_total_pages field in site_stats table.
> ...user_newtalk table already exists.
> ...transcache table already exists.
> ...have iw_trans field in interwiki table.
> ...wl_notificationtimestamp is already nullable.
> ...index times already set on logging table.
> ...have ipb_range_start field in ipblocks table.
> ...no page_random rows needed to be set
> ...have user_registration field in user table.
> ...templatelinks table already exists
> ...externallinks table already exists.
> ...job table already exists.
> ...have ss_images field in site_stats table.
> ...langlinks table already exists.
> ...querycache_info table already exists.
> ...filearchive table already exists.
> ...have ipb_anon_only field in ipblocks table.
> ...index rc_ns_usertext already set on recentchanges table.
> ...index rc_user_text already set on recentchanges table.
> ...have user_newpass_time field in user table.
> ...redirect table already exists.
> ...querycachetwo table already exists.
> ...have ipb_enable_autoblock field in ipblocks table.
> ...index pl_namespace on table pagelinks includes field pl_from.
> ...index tl_namespace on table templatelinks includes field tl_from.
> ...index il_to on table imagelinks includes field il_from.
> ...have rc_old_len field in recentchanges table.
> ...have user_editcount field in user table.
> ...page_restrictions table already exists.
> ...have log_id field in logging table.
> ...have rev_parent_id field in revision table.
> ...have pr_id field in page_restrictions table.
> ...have rev_len field in revision table.
> ...have rc_deleted field in recentchanges table.
> ...have log_deleted field in logging table.
> ...have ar_deleted field in archive table.
> ...have ipb_deleted field in ipblocks table.
> ...have fa_deleted field in filearchive table.
> ...have ar_len field in archive table.
> ...have ipb_block_email field in ipblocks table.
> ...index cl_sortkey on table categorylinks includes field cl_from.
> ...have oi_metadata field in oldimage table.
> ...index usertext_timestamp already set on archive table.
> ...index img_usertext_timestamp already set on image table.
> ...index oi_usertext_timestamp already set on oldimage table.
> ...have ar_page_id field in archive table.
> ...have img_sha1 field in image table.
> ...protected_titles table already exists.
> ...have ipb_by_text field in ipblocks table.
> ...page_props table already exists.
> ...updatelog table already exists.
> ...category table already exists.
> ...category table already populated.
> ...have ar_parent_id field in archive table.
> ...have user_last_timestamp field in user_newtalk table.
> ...protected_titles table has correct pt_title encoding.
> ...have ss_active_users field in site_stats table.
> ...ss_active_users user count set...
> ...have ipb_allow_usertalk field in ipblocks table.
> ...change_tag table already exists.
> ...tag_summary table already exists.
> ...valid_tag table already exists.
> ...user_properties table already exists.
> ...log_search table already exists.
> ...have log_user_text field in logging table.
> ...l10n_cache table already exists.
> ...index change_tag_rc_tag already set on change_tag table.
> ...have rd_interwiki field in redirect table.
> ...transcache tc_time already converted.
> ...*_mime_minor fields are already long enough.
> ...iwlinks table already exists.
> ...index iwl_prefix_title_from already set on iwlinks table.
> ...have ul_value field in updatelog table.
> ...have iw_api field in interwiki table.
> ...iwl_prefix key doesn't exist.
> ...have cl_collation field in categorylinks table.
> ...categorylinks up-to-date.
> ...module_deps table already exists.
> ...ar_page_revid key doesn't exist.
> ...index ar_revid already set on archive table.
> ...ll_lang is up-to-date.
> ...user_last_timestamp is already nullable.
> ...index user_email already set on user table.
> ...up_property in table user_properties already modified by patch
> patch-up_property.sql.
> ...uploadstash table already exists.
> ...user_former_groups table already exists.
> ...index type_action already set on logging table.
> ...have rev_sha1 field in revision table.
> ...batch conversion of user_options: nothing to migrate. done.
> ...user table does not contain user_options field.
> ...have ar_sha1 field in archive table.
> ...index page_redirect_namespace_len already set on page table.
> ...have us_chunk_inx field in uploadstash table.
> ...have job_timestamp field in job table.
> ...index page_user_timestamp already set on revision table.
> ...have ipb_parent_block_id field in ipblocks table.
> ...index ipb_parent_block_id already set on ipblocks table.
> ...category table does not contain cat_hidden field.
> ...have rev_content_format field in revision table.
> ...have rev_content_model field in revision table.
> ...have ar_content_format field in archive table.
> ...have ar_content_model field in archive table.
> ...have page_content_model field in page table.
> Content Handler DB fields should be usable now.
> ...site_stats table does not contain ss_admins field.
> ...recentchanges table does not contain rc_moved_to_title field.
> ...sites table already exists.
> ...have fa_sha1 field in filearchive table.
> ...have job_token field in job table.
> ...have job_attempts field in job table.
> ...have us_props field in uploadstash table.
> ...ug_group in table user_groups already modified by patch
> patch-ug_group-length-increase-255.sql.
> ...ufg_group in table user_former_groups already modified by patch
> patch-ufg_group-length-increase-255.sql.
> ...index pp_propname_page already set on page_props table.
> ...index img_media_mime already set on image table.
> ...iwl_prefix_title_from index is already non-UNIQUE.
> ...index iwl_prefix_from_title already set on iwlinks table.
> ...have ar_id field in archive table.
> ...have el_id field in externallinks table.
> ...have rc_source field in recentchanges table.
> ...index log_user_text_type_time already set on logging table.
> ...index log_user_text_time already set on logging table.
> ...have page_links_updated field in page table.
> ...have user_password_expires field in user table.
> ...have pp_sortkey field in page_props table.
> ...recentchanges table does not contain rc_cur_time field.
> ...index wl_user_notificationtimestamp already set on watchlist table.
> ...have page_lang field in page table.
> ...have pl_from_namespace field in pagelinks table.
> ...have tl_from_namespace field in templatelinks table.
> ...have il_from_namespace field in imagelinks table.
> ...img_major_mime in table image already modified by patch
> patch-img_major_mime-chemical.sql.
> ...oi_major_mime in table oldimage already modified by patch
> patch-oi_major_mime-chemical.sql.
> ...fa_major_mime in table filearchive already modified by patch
> patch-fa_major_mime-chemical.sql.
> ...comment fields are up to date...hitcounter doesn't exist.
> ...site_stats table does not contain ss_total_views field.
> ...page table does not contain page_counter field.
> ...msg_resource_links doesn't exist.
> ...msg_resource doesn't exist.
> Creating bot_passwords table ...[a5a960b4f68493413603554e] [no req]
> Wikimedia\Rdbms\DBQueryError from line 1149 of
> /var/www/html/w/includes/libs/rdbms/database/Database.php: A database
> query error has occurred. Did you forget to run your application's
> database schema updater after upgrading?
> Query: CREATE TABLE `wikicryptopp_bot_passwords` (
>  bp_user int NOT NULL,
>  bp_app_id varbinary(32) NOT NULL,
>  bp_password tinyblob NOT NULL,
>  bp_token binary(32) NOT NULL default '',
>  bp_restrictions blob NOT NULL,
>  bp_grants blob NOT NULL,
>  PRIMARY KEY ( bp_user, bp_app_id )
>  ) utf-8
>
> Function: Wikimedia\Rdbms\Database::sourceFile(
> /var/www/html/w/maintenance/archives/patch-bot_passwords.sql )
> Error: 1064 You have an error in your SQL syntax; check the manual
> that corresponds to your MariaDB server version for the right syntax
> to use near '-8' at line 9 (localhost)
>
> Backtrace:
> #0 /var/www/html/w/includes/libs/rdbms/database/Database.php(979):
> Wikimedia\Rdbms\Database->reportQueryError(string, integer, string,
> string, boolean)
> #1 /var/www/html/w/includes/libs/rdbms/database/Database.php(3325):
> Wikimedia\Rdbms\Database->query(string, string)
> #2 /var/www/html/w/includes/libs/rdbms/database/Database.php(3274):
> Wikimedia\Rdbms\Database->sourceStream(unknown type, NULL, NULL,
> string, NULL)
> #3 /var/www/html/w/includes/installer/DatabaseUpdater.php(673):
> Wikimedia\Rdbms\Database->sourceFile(string)
> #4 /var/www/html/w/includes/installer/DatabaseUpdater.php(716):
> DatabaseUpdater->applyPatch(string, boolean, string)
> #5 /var/www/html/w/includes/installer/DatabaseUpdater.php(472):
> DatabaseUpdater->addTable(string, string)
> #6 /var/www/html/w/includes/installer/DatabaseUpdater.php(436):
> DatabaseUpdater->runUpdates(array, boolean)
> #7 /var/www/html/w/maintenance/update.php(204):
> DatabaseUpdater->doUpdates(array)
> #8 /var/www/html/w/maintenance/doMaintenance.php(92):
UpdateMediaWiki->execute()
> #9 /var/www/html/w/maintenance/update.php(249): require_once(string)
> #10 {main}
> [root@ftpit maintenance]#
>
> _______________________________________________
> MediaWiki-l mailing list
> To unsubscribe, go to:
> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: UTF-8 and Error: 1064 ... syntax to use near '-8' at line 9

Jeffrey Walton
On Thu, Dec 21, 2017 at 8:31 PM, Brian Wolff <[hidden email]> wrote:
> Well first of all, running update.php definitely is mentioned at
> https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script
>
> The error sounds like you have $wgDBTableOptions set incorrectly.

Thanks.

Here's what I see:

    # grep wgDBTableOptions  ../LocalSettings.php
    $wgDBTableOptions   = "utf-8";

Should we set it to ISO-8859-1? Or maybe something else?

A related question, if we set it to ISO-8859-1, then do we need to
change it in PHP too? PHP is set to UTF-8, but I am happy to change ti
to avoid problems. Also see https://www.cryptopp.com/cryptopp.php .

Jeff

> On Thursday, December 21, 2017, Jeffrey Walton <[hidden email]> wrote:
>> We are working on CentOS 7 x86_64 fully patched. We have SCL enabled
>> so Apache 2.4.58, PHP 7.1.8 and MariaDB 5.5.56 are being used.
>>
>> We are trying to upgrade from MediaWiki 1.26 to 1.30. We are following
>> https://www.mediawiki.org/wiki/Manual:Upgrading. We have been catching
>> database errors so we are trying to run update.php per
>> https://www.mediawiki.org/wiki/Topic:U26n1a1pgo0078tt (the update.php
>> step is missing from Manual:Upgrading, so we did not run it first).
>>
>> The update is failing due to a syntax error. The "-8" below appears to
>> be related to literal UTF-8. We are not sure how to proceed.
>>
>> We also noticed a message "Database.php: A database query error has
>> occurred. Did you forget to run your application's database schema
>> updater after upgrading?". A database schema updater is not discussed
>> at Manual:Upgrading, so we are not sure what to do.
>>
>> We found
>> https://stackoverflow.com/questions/35631265/mysql-error-1064-default-character-set-utf8
>> , but the answer does not provide enough details for us to take
>> action.
>>
>> Any help in getting our wiki back online would be greatly appreciated.
>>
>> **************************************************
>>
>> [root@ftpit maintenance]# pwd
>> /var/www/html/w/maintenance
>>
>> [root@ftpit maintenance]# php ./update.php
>> PHP Notice:  Undefined index: SERVER_NAME in
>> /var/www/html/w/includes/GlobalFunctions.php on line 1507
>> PHP Notice:  Undefined index: SERVER_NAME in
>> /var/www/html/w/includes/GlobalFunctions.php on line 1507
>> MediaWiki 1.30.0 Updater
>>
>> Your composer.lock file is up to date with current dependencies!
>> Going to run database updates for my_wiki-wikicryptopp_
>> Depending on the size of your database this may take a while!
>> Abort with control-c in the next five seconds (skip this countdown
>> with --quick) ... 0
>> Turning off Content Handler DB fields for this part of upgrade.
>> ...have ipb_id field in ipblocks table.
>> ...have ipb_expiry field in ipblocks table.
>> ...already have interwiki table
>> ...indexes seem up to 20031107 standards.
>> ...have rc_type field in recentchanges table.
>> ...index new_name_timestamp already set on recentchanges table.
>> ...have user_real_name field in user table.
>> ...querycache table already exists.
>> ...objectcache table already exists.
>> ...categorylinks table already exists.
>> ...have pagelinks; skipping old links table updates
>> ...il_from OK
>> ...have rc_ip field in recentchanges table.
>> ...index PRIMARY already set on image table.
>> ...have rc_id field in recentchanges table.
>> ...have rc_patrolled field in recentchanges table.
>> ...logging table already exists.
>> ...have user_token field in user table.
>> ...have wl_notificationtimestamp field in watchlist table.
>> ...watchlist talk page rows already present.
>> ...user table does not contain user_emailauthenticationtimestamp field.
>> ...page table already exists.
>> ...have log_params field in logging table.
>> ...logging table has correct log_title encoding.
>> ...have ar_rev_id field in archive table.
>> ...have page_len field in page table.
>> ...revision table does not contain inverse_timestamp field.
>> ...have rev_text_id field in revision table.
>> ...have rev_deleted field in revision table.
>> ...have img_width field in image table.
>> ...have img_metadata field in image table.
>> ...have user_email_token field in user table.
>> ...have ar_text_id field in archive table.
>> ...page_namespace is already a full int (int(11)).
>> ...ar_namespace is already a full int (int(11)).
>> ...rc_namespace is already a full int (int(11)).
>> ...wl_namespace is already a full int (int(11)).
>> ...qc_namespace is already a full int (int(11)).
>> ...log_namespace is already a full int (int(11)).
>> ...have img_media_type field in image table.
>> ...already have pagelinks table.
>> ...image table does not contain img_type field.
>> ...already have unique user_name index.
>> ...user_groups table exists and is in current format.
>> ...have ss_total_pages field in site_stats table.
>> ...user_newtalk table already exists.
>> ...transcache table already exists.
>> ...have iw_trans field in interwiki table.
>> ...wl_notificationtimestamp is already nullable.
>> ...index times already set on logging table.
>> ...have ipb_range_start field in ipblocks table.
>> ...no page_random rows needed to be set
>> ...have user_registration field in user table.
>> ...templatelinks table already exists
>> ...externallinks table already exists.
>> ...job table already exists.
>> ...have ss_images field in site_stats table.
>> ...langlinks table already exists.
>> ...querycache_info table already exists.
>> ...filearchive table already exists.
>> ...have ipb_anon_only field in ipblocks table.
>> ...index rc_ns_usertext already set on recentchanges table.
>> ...index rc_user_text already set on recentchanges table.
>> ...have user_newpass_time field in user table.
>> ...redirect table already exists.
>> ...querycachetwo table already exists.
>> ...have ipb_enable_autoblock field in ipblocks table.
>> ...index pl_namespace on table pagelinks includes field pl_from.
>> ...index tl_namespace on table templatelinks includes field tl_from.
>> ...index il_to on table imagelinks includes field il_from.
>> ...have rc_old_len field in recentchanges table.
>> ...have user_editcount field in user table.
>> ...page_restrictions table already exists.
>> ...have log_id field in logging table.
>> ...have rev_parent_id field in revision table.
>> ...have pr_id field in page_restrictions table.
>> ...have rev_len field in revision table.
>> ...have rc_deleted field in recentchanges table.
>> ...have log_deleted field in logging table.
>> ...have ar_deleted field in archive table.
>> ...have ipb_deleted field in ipblocks table.
>> ...have fa_deleted field in filearchive table.
>> ...have ar_len field in archive table.
>> ...have ipb_block_email field in ipblocks table.
>> ...index cl_sortkey on table categorylinks includes field cl_from.
>> ...have oi_metadata field in oldimage table.
>> ...index usertext_timestamp already set on archive table.
>> ...index img_usertext_timestamp already set on image table.
>> ...index oi_usertext_timestamp already set on oldimage table.
>> ...have ar_page_id field in archive table.
>> ...have img_sha1 field in image table.
>> ...protected_titles table already exists.
>> ...have ipb_by_text field in ipblocks table.
>> ...page_props table already exists.
>> ...updatelog table already exists.
>> ...category table already exists.
>> ...category table already populated.
>> ...have ar_parent_id field in archive table.
>> ...have user_last_timestamp field in user_newtalk table.
>> ...protected_titles table has correct pt_title encoding.
>> ...have ss_active_users field in site_stats table.
>> ...ss_active_users user count set...
>> ...have ipb_allow_usertalk field in ipblocks table.
>> ...change_tag table already exists.
>> ...tag_summary table already exists.
>> ...valid_tag table already exists.
>> ...user_properties table already exists.
>> ...log_search table already exists.
>> ...have log_user_text field in logging table.
>> ...l10n_cache table already exists.
>> ...index change_tag_rc_tag already set on change_tag table.
>> ...have rd_interwiki field in redirect table.
>> ...transcache tc_time already converted.
>> ...*_mime_minor fields are already long enough.
>> ...iwlinks table already exists.
>> ...index iwl_prefix_title_from already set on iwlinks table.
>> ...have ul_value field in updatelog table.
>> ...have iw_api field in interwiki table.
>> ...iwl_prefix key doesn't exist.
>> ...have cl_collation field in categorylinks table.
>> ...categorylinks up-to-date.
>> ...module_deps table already exists.
>> ...ar_page_revid key doesn't exist.
>> ...index ar_revid already set on archive table.
>> ...ll_lang is up-to-date.
>> ...user_last_timestamp is already nullable.
>> ...index user_email already set on user table.
>> ...up_property in table user_properties already modified by patch
>> patch-up_property.sql.
>> ...uploadstash table already exists.
>> ...user_former_groups table already exists.
>> ...index type_action already set on logging table.
>> ...have rev_sha1 field in revision table.
>> ...batch conversion of user_options: nothing to migrate. done.
>> ...user table does not contain user_options field.
>> ...have ar_sha1 field in archive table.
>> ...index page_redirect_namespace_len already set on page table.
>> ...have us_chunk_inx field in uploadstash table.
>> ...have job_timestamp field in job table.
>> ...index page_user_timestamp already set on revision table.
>> ...have ipb_parent_block_id field in ipblocks table.
>> ...index ipb_parent_block_id already set on ipblocks table.
>> ...category table does not contain cat_hidden field.
>> ...have rev_content_format field in revision table.
>> ...have rev_content_model field in revision table.
>> ...have ar_content_format field in archive table.
>> ...have ar_content_model field in archive table.
>> ...have page_content_model field in page table.
>> Content Handler DB fields should be usable now.
>> ...site_stats table does not contain ss_admins field.
>> ...recentchanges table does not contain rc_moved_to_title field.
>> ...sites table already exists.
>> ...have fa_sha1 field in filearchive table.
>> ...have job_token field in job table.
>> ...have job_attempts field in job table.
>> ...have us_props field in uploadstash table.
>> ...ug_group in table user_groups already modified by patch
>> patch-ug_group-length-increase-255.sql.
>> ...ufg_group in table user_former_groups already modified by patch
>> patch-ufg_group-length-increase-255.sql.
>> ...index pp_propname_page already set on page_props table.
>> ...index img_media_mime already set on image table.
>> ...iwl_prefix_title_from index is already non-UNIQUE.
>> ...index iwl_prefix_from_title already set on iwlinks table.
>> ...have ar_id field in archive table.
>> ...have el_id field in externallinks table.
>> ...have rc_source field in recentchanges table.
>> ...index log_user_text_type_time already set on logging table.
>> ...index log_user_text_time already set on logging table.
>> ...have page_links_updated field in page table.
>> ...have user_password_expires field in user table.
>> ...have pp_sortkey field in page_props table.
>> ...recentchanges table does not contain rc_cur_time field.
>> ...index wl_user_notificationtimestamp already set on watchlist table.
>> ...have page_lang field in page table.
>> ...have pl_from_namespace field in pagelinks table.
>> ...have tl_from_namespace field in templatelinks table.
>> ...have il_from_namespace field in imagelinks table.
>> ...img_major_mime in table image already modified by patch
>> patch-img_major_mime-chemical.sql.
>> ...oi_major_mime in table oldimage already modified by patch
>> patch-oi_major_mime-chemical.sql.
>> ...fa_major_mime in table filearchive already modified by patch
>> patch-fa_major_mime-chemical.sql.
>> ...comment fields are up to date...hitcounter doesn't exist.
>> ...site_stats table does not contain ss_total_views field.
>> ...page table does not contain page_counter field.
>> ...msg_resource_links doesn't exist.
>> ...msg_resource doesn't exist.
>> Creating bot_passwords table ...[a5a960b4f68493413603554e] [no req]
>> Wikimedia\Rdbms\DBQueryError from line 1149 of
>> /var/www/html/w/includes/libs/rdbms/database/Database.php: A database
>> query error has occurred. Did you forget to run your application's
>> database schema updater after upgrading?
>> Query: CREATE TABLE `wikicryptopp_bot_passwords` (
>>  bp_user int NOT NULL,
>>  bp_app_id varbinary(32) NOT NULL,
>>  bp_password tinyblob NOT NULL,
>>  bp_token binary(32) NOT NULL default '',
>>  bp_restrictions blob NOT NULL,
>>  bp_grants blob NOT NULL,
>>  PRIMARY KEY ( bp_user, bp_app_id )
>>  ) utf-8
>>
>> Function: Wikimedia\Rdbms\Database::sourceFile(
>> /var/www/html/w/maintenance/archives/patch-bot_passwords.sql )
>> Error: 1064 You have an error in your SQL syntax; check the manual
>> that corresponds to your MariaDB server version for the right syntax
>> to use near '-8' at line 9 (localhost)
>>
>> Backtrace:
>> #0 /var/www/html/w/includes/libs/rdbms/database/Database.php(979):
>> Wikimedia\Rdbms\Database->reportQueryError(string, integer, string,
>> string, boolean)
>> #1 /var/www/html/w/includes/libs/rdbms/database/Database.php(3325):
>> Wikimedia\Rdbms\Database->query(string, string)
>> #2 /var/www/html/w/includes/libs/rdbms/database/Database.php(3274):
>> Wikimedia\Rdbms\Database->sourceStream(unknown type, NULL, NULL,
>> string, NULL)
>> #3 /var/www/html/w/includes/installer/DatabaseUpdater.php(673):
>> Wikimedia\Rdbms\Database->sourceFile(string)
>> #4 /var/www/html/w/includes/installer/DatabaseUpdater.php(716):
>> DatabaseUpdater->applyPatch(string, boolean, string)
>> #5 /var/www/html/w/includes/installer/DatabaseUpdater.php(472):
>> DatabaseUpdater->addTable(string, string)
>> #6 /var/www/html/w/includes/installer/DatabaseUpdater.php(436):
>> DatabaseUpdater->runUpdates(array, boolean)
>> #7 /var/www/html/w/maintenance/update.php(204):
>> DatabaseUpdater->doUpdates(array)
>> #8 /var/www/html/w/maintenance/doMaintenance.php(92):
>> UpdateMediaWiki->execute()
>> #9 /var/www/html/w/maintenance/update.php(249): require_once(string)
>> #10 {main}
>> [root@ftpit maintenance]#
>>
>> _______________________________________________
>> MediaWiki-l mailing list
>> To unsubscribe, go to:
>> https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>>

_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: UTF-8 and Error: 1064 ... syntax to use near '-8' at line 9

Brion Vibber-4
In reply to this post by Jeffrey Walton
On Thu, Dec 21, 2017 at 5:20 PM, Jeffrey Walton <[hidden email]> wrote:

>
> The update is failing due to a syntax error. The "-8" below appears to
> be related to literal UTF-8. We are not sure how to proceed.
>
> We also noticed a message "Database.php: A database query error has
> occurred. Did you forget to run your application's database schema
> updater after upgrading?". A database schema updater is not discussed
> at Manual:Upgrading, so we are not sure what to do.
>

It looks like $wgDBTableOptions has been set to just the string "UTF-8".
Can you double-check the value in your LocalSettings.php? It should be
something like "ENGINE=InnoDB CHARSET=utf8" if you're using the UTF-8
schema.

See https://www.mediawiki.org/wiki/Manual:$wgDBTableOptions for more info
on this setting.

-- brion
_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Reply | Threaded
Open this post in threaded view
|

Re: UTF-8 and Error: 1064 ... syntax to use near '-8' at line 9

Jeffrey Walton
On Thu, Dec 21, 2017 at 8:37 PM, Brion Vibber <[hidden email]> wrote:

> On Thu, Dec 21, 2017 at 5:20 PM, Jeffrey Walton <[hidden email]> wrote:
>>
>>
>> The update is failing due to a syntax error. The "-8" below appears to
>> be related to literal UTF-8. We are not sure how to proceed.
>>
>> We also noticed a message "Database.php: A database query error has
>> occurred. Did you forget to run your application's database schema
>> updater after upgrading?". A database schema updater is not discussed
>> at Manual:Upgrading, so we are not sure what to do.
>
> It looks like $wgDBTableOptions has been set to just the string "UTF-8". Can
> you double-check the value in your LocalSettings.php? It should be something
> like "ENGINE=InnoDB CHARSET=utf8" if you're using the UTF-8 schema.
>
> See https://www.mediawiki.org/wiki/Manual:$wgDBTableOptions for more info on
> this setting.

Thanks Brion. The new setting got past the update.php error.

Thanks again.

Jeff

_______________________________________________
MediaWiki-l mailing list
To unsubscribe, go to:
https://lists.wikimedia.org/mailman/listinfo/mediawiki-l