[wp-trac] [WordPress Trac] #40655: DB error during installation

WordPress Trac noreply at wordpress.org
Fri Sep 1 09:10:55 UTC 2017


#40655: DB error during installation
--------------------------+------------------
 Reporter:  FlyerUA       |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  4.9
Component:  Database      |     Version:  4.6
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------

Comment (by danieltj):

 Replying to [comment:1 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.' )
 );
   }
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40655#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list