Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#9747 closed defect (bug) (wontfix)

Installer does not try to create the database if it fails to select

Reported by: hakre Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.8
Component: Upgrade/Install Keywords: needs-patch
Focuses: Cc:


while doing a test for #9706 i needed to deleted wordpress to get a new installation.

therefore i dropped the database as well.

while being in the installer it came to my attention that the installer does not try to create the database if it does not exists.

creating the database while setting up wordpress would help to make the installation process less error-prone.

Attachments (2)

9747.patch (840 bytes) - added by hakre 9 years ago.
If dbselect fails the first time, database will be created.
9747.2.patch (1.3 KB) - added by hakre 9 years ago.
Code moved into installing only; CREATE SQL-Statement fixed.

Download all attachments as: .zip

Change History (14)

9 years ago

If dbselect fails the first time, database will be created.

#1 @DD32
9 years ago

-1 for the code block in that location to start with. It should go in the installer somewhere instead.

Many shared hosting setups are setup as such, that creating databases isn't possible. I'd say thats the main reason its not currently done.

#2 @hakre
9 years ago

i'll take a look for the installer instead, good point.

might be related somehow: #4027

9 years ago

Code moved into installing only; CREATE SQL-Statement fixed.

#3 @hakre
9 years ago

new patch. code is now install-only. the create statement had a bug as well, wpdb prepare is not able to handle database names with its routines therefore preparing has been removed.

#4 @Denis-de-Bernardy
9 years ago

  • Keywords needs-patch added; has-patch removed

it should use the constants in wp-config for the charset and collation.

#5 @Denis-de-Bernardy
9 years ago

  • Milestone changed from 2.8 to Future Release

#6 @Denis-de-Bernardy
9 years ago

  • Keywords 2nd-opinion removed

#7 @mrmist
9 years ago

I reckon this would bomb out in most cases. You're basically going to have 2 different user types - the first type has their own dedicated server, is pretty tech savvy, and would already have created the mysql database. The second type has shared hosting and more than likely can't create databases on the fly, having to go through their hosting CP instead.

It's worth a go, but it could probably try to check permissions first, or something.

#8 @mrmist
9 years ago

Actually there's a third type where they made a typo in the database config file. Not sure creating a new db is the way to go there.

#9 @Denis-de-Bernardy
9 years ago

almost certainly not, in the case of a typo. :D

close as wontfix?

#11 @hakre
9 years ago

Well for me as tech savy user it made testing easier and since it is install only it won't hurt the ones that are unable to connect to the db because of having not the propper rights. This is checked before.

But it is a minor thing I stumbeled over while doing some more rare tests.

#12 @Denis-de-Bernardy
9 years ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

see comments above

Note: See TracTickets for help on using tickets.