#40655 closed defect (bug) (fixed)
DB error during installation
Reported by: | FlyerUA | Owned by: | pento |
---|---|---|---|
Milestone: | 4.9 | Priority: | normal |
Severity: | normal | Version: | 4.6 |
Component: | Database | Keywords: | |
Focuses: | Cc: |
Description
$wpdb->query( "SELECT $prefix" );
at line 279 of setup-config.php throws a DB error and that's not exactly nice thing to have during installation. If you insist on having a check like this, perhaps suppress the error from this call?
Change History (9)
#1
follow-up:
↓ 3
@
7 years ago
- Component changed from General to Database
- Milestone changed from Awaiting Review to 4.9
- Version changed from 4.7.4 to 4.6
#3
in reply to:
↑ 1
;
follow-up:
↓ 4
@
7 years ago
Replying to SergeyBiryukov:
Found a few other reports:
https://wordpress.org/support/topic/unknown-column-wp_-error-when-installing-wordpress-46/
https://wordpress.org/support/topic/installing-wordpress-46/
https://wordpress.org/support/topic/problem-installing-4-7-on-iis-7-with-php-7/
At least two of them mention that the issue happens when installing WordPress on IIS.
The error message is:
Unknown column 'wp_' in 'field list' for query SELECT wp_Introduced in [37581]. cc @pento
I'd suggest that we just make it more user friendly like the other error messages. I think what it's doing is fine because it'll error anyway when using an invalid prefix so the idea is we have the user change it at some point to something valid. I've slightly changed the wording and added the return link to easily go back.
So what about this?
setup-config.php (line 279)
$wpdb->query( "SELECT $prefix" ); if ( ! $wpdb->last_error ) { // MySQL was able to parse the prefix as a value, which we don't want. Bail. wp_die( __( '<strong>ERROR</strong>: "Table Prefix" is invalid, please choose a different prefix.' . $tryagain_link ) ); }
...which replaces this
$wpdb->query( "SELECT $prefix" ); if ( ! $wpdb->last_error ) { // MySQL was able to parse the prefix as a value, which we don't want. Bail. wp_die( __( '<strong>ERROR</strong>: "Table Prefix" is invalid.' ) ); }
#4
in reply to:
↑ 3
;
follow-up:
↓ 5
@
7 years ago
Replying to danieltj:
I'd suggest that we just make it more user friendly like the other error messages. I think what it's doing is fine because it'll error anyway when using an invalid prefix so the idea is we have the user change it at some point to something valid.
I don't mind making the "Table Prefix" is invalid
message more friendly, but that's not the issue here, wp_
is a perfectly valid prefix.
The check added in [37581] is supposed to disallow prefixes like 7e1_
that could be parsed as a value. This appears to work as expected, but in some cases it triggers the Unknown column 'wp_' in 'field list' for query SELECT wp_
error, which should be silently discarded, not displayed to the user.
#5
in reply to:
↑ 4
@
7 years ago
Replying to SergeyBiryukov:
Replying to danieltj:
I'd suggest that we just make it more user friendly like the other error messages. I think what it's doing is fine because it'll error anyway when using an invalid prefix so the idea is we have the user change it at some point to something valid.
I don't mind making the
"Table Prefix" is invalid
message more friendly, but that's not the issue here,wp_
is a perfectly valid prefix.
The check added in [37581] is supposed to disallow prefixes like
7e1_
that could be parsed as a value. This appears to work as expected, but in some cases it triggers theUnknown column 'wp_' in 'field list' for query SELECT wp_
error, which should be silently discarded, not displayed to the user.
Ahh I see. I'll have to revisit this then because I couldn't replicate the wp_
prefix error, only with the 7e1_
prefix.
#6
@
7 years ago
- Owner set to pento
- Resolution set to fixed
- Status changed from new to closed
In 41631:
#8
@
7 years ago
AS I am stuck with my installation due to this error "Unknown column 'wp_' in 'field list'", is there any alternate way to install wordpress. Is this is the problem due to my mysql version (5.7 ) or word press (4.8.2). Will this be resolved if I use older versions.
Please help as I am stuck with my project.
Found a few other reports:
At least two of them mention that the issue happens when installing WordPress on IIS.
The error message is:
Introduced in [37581]. cc @pento