Make WordPress Core

Opened 8 weeks ago

Closed 4 days 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: trunk
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 (4)

#1 @mikemanzo
10 days 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
10 days 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
5 days ago

  • Severity changed from normal to major

#4 @SergeyBiryukov
4 days 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.

Note: See TracTickets for help on using tickets.