Make WordPress Core

Opened 4 years ago

Last modified 7 weeks ago

#42362 reviewing defect (bug)

WordPress database error Unknown column 'wp_mywordpresssite' in 'field list'

Reported by: lazam786 Owned by: SergeyBiryukov
Milestone: 6.0 Priority: normal
Severity: normal Version: 4.6
Component: Database Keywords: has-patch php8 php81
Focuses: Cc:


I am trying to install wordpress 4.8 on PHP 5.6 and Windows 7 IIS 7.5. During new installation, I gave my database details adnd table prefix as wp_mywordpresssite. It throws an error as below.

WordPress database error Unknown column 'wp_mywordpresssite' in 'field list'.

Please let me know fi anybody has any solution to move forward with my installation.

I am using old PHP version to mimic my production instance. If that be the issue please let me know.

Attachments (1)

42362.diff (665 bytes) - added by pento 4 years ago.

Download all attachments as: .zip

Change History (35)

#1 @SergeyBiryukov
4 years ago

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

Hi @lazam786, welcome to WordPress Trac!

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

#2 @lazam786
4 years ago

  • Resolution duplicate deleted
  • Status changed from closed to reopened

Hi SergeyBiryukov,

The ticket #40655 is all about changing the error message displayed. I am getting this error irrespective of my database connection is good and it stops with this message after I provide my db creds.

WordPress database error Unknown column 'wp_' in 'field list' for query SELECT wp_

It is not able to move forward after thsi step and no DB setup is performed.

I see 40655 is close as fix provided but I dont find a fix for the above issue. COuld you please help me in this regard.

#3 @Velochicdunord
4 years ago

I also ran into this error. I've asked a question about it at the users install forum.

The details for my installation error as follows:

Setting up WordPress 4.9.1 within MAMP 4.2 on a Mac 10.11.6 OS for a friend to do some testing.

The installation is hanging up on the install.php file and not finishing. When I abort the installation, the files are installed, but I’m getting the white screen of death.

I’ve been using the MAMP logs to track the errors – the error message is:
WordPress database error Unknown column ‘customprefix_’ in ‘field list’ for query SELECT customprefix_

While we’re using PHP version 7.1.8 within MAMP, the Mac OS is running PHP 5.5.38.
I was wondering if there has been a significant change in some of the PHP call properties.

Last edited 4 years ago by Velochicdunord (previous) (diff)

#4 @SergeyBiryukov
4 years ago

  • Milestone set to Awaiting Review

#5 @SergeyBiryukov
4 years ago

#43167 was marked as a duplicate.

#6 @SergeyBiryukov
4 years ago

  • Milestone changed from Awaiting Review to 4.9.5

Let's try the suggestion from comment:2:ticket:43167.

#7 @audrasjb
4 years ago

  • Milestone changed from 4.9.5 to 4.9.6

Bumping to 4.9.6 due to 4.9.5 beta release.

#8 @blackawxs
4 years ago

I'm also having this issue as of today. Please let me know if anything appears as a red flag but I believe I have done everything correctly....

My Specs:

  • I have MySQL Community (Server only installed). Version Tested it and its running
  • I have PHP 5.6.35 installed. Tested it and its running
  • I have IIS10 running with FastCgiModule running to serve the PHP. No issues there.
  • I created a virtual directory on my development machine, so I am able to go to mysite.sanbox/v01/wordpress and see the default wordpress page to pick a language. That is fine. I click next.
  • I then use phpmyadmin to create my new database table. That is fine.
  • I then go back to mysite.sanddbox/v01/wordpress and I put in my database information.
  • I then click next. The next page is white and says WordPress database error Unknown column 'wp_' in 'field list' for query SELECT wp_. I have attempted a different database name and different prefix, but no luck.
  • I have attempted to install WordPress versions, and also tried Same issue in all three cases.

Would anyone have a clue as to why this is happening?

Version 0, edited 4 years ago by blackawxs (next)

#9 @blackawxs
4 years ago

An unexpected behavior occurred...I went into my php.ini file and set an error_log directory, and set display_errors = On. From that moment, the wp-config.php was created and I was able to complete the installation process. I'm not sure if this solved it, but I'm working again now.

...I also made sure IUSR AND IIS_IUSRS had proper permissions on the directory....

Last edited 4 years ago by blackawxs (previous) (diff)

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

4 years ago

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

4 years ago

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

4 years ago

#13 @desrosj
4 years ago

  • Keywords needs-patch added
  • Milestone changed from 4.9.6 to 4.9.7

Punting due to lack of patch.

#14 @desrosj
4 years ago

  • Milestone changed from 4.9.7 to 4.9.8

Moving all tickets in 4.9.7 to 4.9.8.

#15 @codewhy
4 years ago

@desrosj Can you please advise if there is any recommended workaround for this problem (I just noticed a fix has been pushed back further from 4.9.7 to v4.9.8)? I've lost a couple of days systematically trying to fix this issue, finding it mentioned in various forms, scattered across the web. I eventually decided to log it as a bug and came across this ticket when searching on the PHP error.

My situation is very similar to @Velochicdunord - I have Mac OSX 10.11.6, MAMP 4.4.1 (PHP 7.2.1) and Wordpress 4.9.5. After clicking the Install Wordpress button, the same PHP error is logged and the browser is left hanging waiting for a response.

The main difference for me is that if I then navigate to the wordpress local hosting URL, the the basic website appears and I can log in to the Wordpress editor. So the database tables are also created - BUT I have no way of knowing if the installation has completed successfully - and if it hasn't, then what issues this will cause downstream if I continue regardless.

This has stopped me in my tracks in trying to setup a local dev instance of Wordpress. Would really appreciate any advice in how I can workaround it (other than setting up a virtual private server in the cloud), or how I can determine if the local installation has in fact completed successfully and won't cause problems later.

#16 @psykro
4 years ago

@codewhy have you made any changes to the PHP error reporting settings on your MAMP install?

I have just tried to replicate this on a clean MAC OSX 10.11 install and a clean MAMP 4.4.1 install and the install worked as expected. So I'd like to try and find out if there's any differences between your setup and mine that would help me replicate the problem.

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

4 years ago

#18 @codewhy
4 years ago

@psykro Thanks for looking into this.

I worked through a simple installation of wordpress and only started changing settings like the PHP error logging when I encountered the problem, for troubleshooting purposes. I did increase logging verbosity purely to try to obtain the most detailed logging possible about the problem occurring (ie. the browser hanging after clicking 'Install Wordpress' with 'Waiting for localhost' displayed on the status bar).

The last error I was able to find that was logged was:
"[21-May-2018 13:19:29 UTC] WordPress database error Unknown column 'wp_' in 'field list' for query SELECT wp_"

I tried an array of other things to get to the bottom of this but without success.

Not sure if this sheds any light on the problem for you? If not, can you please advise if there is any way I can determine with certainty if the wordpress installation has in fact completed successfully?

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

4 years ago

4 years ago

#20 @pento
4 years ago

  • Keywords has-patch added; needs-patch removed
  • Version changed from 4.8.2 to 4.6

This message is occurring because [41631] wasn't suppressing all errors, 42362.diff suppresses the error more aggressively. We want this error to be triggered (it proves that it's an appropriate table prefix), but we don't want it to be displayed at all.

This should also fix the problem where the install process appears to stall. After this error messages is displayed, setup_config_display_header() is called, which has a header() call. I suspect some browsers get confused when they're sent content, then a header, then more content.

As a workaround, you should ensure display_errors is set to 0 in your php.ini file. This will prevent errors from being displayed in the browser.

#21 @pento
4 years ago

  • Keywords needs-testing added
  • Milestone changed from 4.9.8 to 4.9.9

As this patch still needs testing, I'm moving it to 4.9.9. If an existing commenter can confirm that the bug is fixed in the next day or two, it can potential be moved back to 4.9.8.

#22 @codewhy
4 years ago

Thanks @pento . I will try to test that the install process no longer stalls soon. Given testing involves performing a fresh installation, can you please advise where I should obtain the download file (that includes this patch) from? I've had a look at the Releases page, Beta/Nightly page, Beta Testing page and the needs testing tickets, but can't see where I can obtain the install file that would allow me to test this installation bug.

Or would you rather I unpacked the latest stable release version (v4.9.7) and replace the setup-config.php file with the file containing your fix from the source code repo, before running the install.php script?

#23 @pento
4 years ago

Thank you for offering to test this, @codewhy!

There isn't a location to download the file, you'll need to unpack the latest stable version, and edit the changes into setup-config.php. If you're comfortable applying patch files, then 42362.diff can be used for that. Otherwise, the manual edits you need to make are:

  • On line 287, replace hide_errors with suppress_errors.
  • On line 289, replace show_errors with suppress_errors.

Once you've applied these changes, please run through the normal install process.

#24 @codewhy
4 years ago

Sorry @pento - no joy with the testing. I've tested the same setup described in my previous post, except using wordpress v4.9.7 and then following your instructions. The page hangs in exactly the same manner described previously.
I also tried adding in debug config lines into wp-config.php:

define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);

...but no log files were created - not surprising I guess given the suppress_errors setting we're testing in the setup-config.php file, but thought I would try it anyway in case it gave you something more to go on.

#25 @pento
4 years ago

  • Keywords needs-testing removed
  • Milestone changed from 4.9.9 to Future Release

Thanks for testing that, @codewhy.

This is going to need more investigation to figure out the cause.

#26 @SergeyBiryukov
3 years ago

  • Milestone changed from Future Release to 5.1
  • Owner set to SergeyBiryukov
  • Status changed from reopened to reviewing

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

3 years ago

#28 @pento
3 years ago

  • Milestone changed from 5.1 to Future Release

#29 @burgiuk
3 years ago

I'm still getting this in a fresh install of 5.2.1. I'm running IIS on Windows 10. I've never had this problem before.

What do you need from me for testing?

#30 @mdrago
21 months ago

Been 2 days fighting with this same problem...


  • Windows 2019, clean install (IIS 10)
  • PHP 7.4.5 nts
  • MySQL 8.0.20 (also tried with 5.7, same error)
  • WP 5.4.1

To solve the issue you must edit your php.ini in your PHP folder:

display_errors = On
error_log = php_errors.log

Setting error_log solves the issue... I guess that when error_log has no value (default configuration), PHP decides to send the error back to the calling program, resulting in the error message column 'wp_' in 'field list' during the WP installation.

During the installation process, the WP installer should check that PHP is configured correctly to continue with the installation.

#31 @kykyfyfyf
21 months ago

To me was solution next(in your php.ini) :

fastcgi.impersonate = 1
fastcgi.logging = 0
cgi.force_redirect = 0
Last edited 21 months ago by kykyfyfyf (previous) (diff)

#32 @SergeyBiryukov
7 weeks ago

#54579 was marked as a duplicate.

#33 @SergeyBiryukov
7 weeks ago

  • Keywords php8 php81 added
  • Milestone changed from Future Release to 6.0

Just noting that the error appears to be more prominent with PHP 8.1, as reported in #54579:

[php:error] [pid 18811] [client] PHP Fatal error:  Uncaught mysqli_sql_exception: > > > Unknown column 'wp_' in 'field list' in /var/www/
Stack trace:
#0 /var/www/ mysqli_query()
#1 /var/www/ wpdb->_do_query()
#2 /var/www/ wpdb->query()
#3 {main}
  thrown in /var/www/ on line 2056, referer:

I am running Ubuntu 20.04, PHP 8.1.0, MySQL 8.0.27, Apache 2.4.41

#34 @maythamalsudany
7 weeks ago

What is the purpose of SELECT $prefix in wp-admin/setup-config.php:317?

If it's causing the issue and has no purpose, then might as well remove it.

Note: See TracTickets for help on using tickets.