Make WordPress Core

Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#43167 closed defect (bug) (duplicate)

Unable to install worpress, error on wp-admin/setup-config.php

Reported by: irecinius Owned by:
Milestone: Priority: normal
Severity: major Version: 5.1
Component: Database Keywords:
Focuses: Cc:


Install Step 2: fails with message
"WordPress database error Unknown column 'wp_' in 'field list' for query SELECT wp_"

RESPONSE -> '5.6.38-83.0-log'


Running the query:
$wpdb->query( "SELECT $prefix" );

RESPONSE -> Error Code: 1054. Unknown column 'wp_' in 'field list'

Observations, query fails regardless if prefix exists or not, tested on a working database, same query fails with same message

Change History (5)

#1 @mikemanzo
4 years ago

Same issue

MySQL (v): 5.7.21
PHP (v): 7.2.3

Error: WordPress database error Unknown column 'wp_' in 'field list' for query SELECT wp_, referer: https://rusticcoders.com/wp-admin/setup-config.php?step=1

#2 @dd32
4 years ago

I feel like there's another ticket for this, however, I'm wondering if the following will both work with the intended purpose of this code and work with modern MySQL/PHP:

$wpdb->query( $wpdb->prepare( "SELECT %s AS $prefix", $prefix ) )

This check is to validate that the database prefix chosen is viable on the MySQL variant unquoted, ie. "Can I query for '{$prefix}posts' or would I need to escape characters in the $prefix for it to work".

#3 @mikemanzo
4 years ago

  • Severity changed from normal to major

#4 @SergeyBiryukov
4 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Hi @irecinius, welcome to WordPress Trac!

Thanks for the report, we're already tracking this issue in #42362.

This ticket was mentioned in Slack in #core by desrosj. View the logs.

4 years ago

Note: See TracTickets for help on using tickets.