Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#15210 closed defect (bug) (worksforme)

If your table prefix ends with a number, you can't use MultiSite

Reported by: ipstenu Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: General Keywords:
Focuses: Cc:


in the wp-config.php, if you set your prefix like this:

$table_prefix = 'wp_1';

as many people do for the old days of multiple installs in one DB, you can't use MultiSite, because it saves each sub-site as 'wp_1n' and then you get wp_12 for sub-site #2, which confuses the MultiSite and it can't find anything.

Frankly, I can't think of a way around that easily, and it may be a known bug, but... maybe someone smart can go 'Ah hah!'

The 'fix' is to rename your prefix so it DOES NOT end with a number, and then rename your tables.

Change History (7)

comment:1 viniciusmassuchetto3 years ago

  • Summary changed from If your table prefix ends with a number, you can't use MultiSite to maybe just use verification?

Maybe it's just better to use a form verification on installation and a verifier on $wpdb initialization. Modifying users settings don't seem right to me.

comment:2 viniciusmassuchetto3 years ago

  • Summary changed from maybe just use verification? to If your table prefix ends with a number, you can't use MultiSite

switching back the summary... sorry

comment:3 ipstenu3 years ago

Or a check when you're enabling Multisite. "WordPress has detected a problem with your database configuration. In order to use WordPress Multisite, your table prefix cannot end with a number. Yours is 'wp_1'."

comment:4 nacin3 years ago

I'm curious why this is a problem, as it simply uses the base prefix (table_prefix) plus the blog_id. wp_12 should be correctly parsed as blog 2 on the wp_1 install.

comment:5 SergeyBiryukov3 years ago

I was able to create a network with wpms31rc1_1 prefix and subdirectory setup. The second site got wpms31rc1_12_ prefix and seems to be working correctly.

comment:6 PeteMall3 years ago

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

If your table_prefix is something like wp_1 then the second blog goes under wp_12. Feel free to reopen if you can show how it breaks multisite.

comment:7 ipstenu3 years ago

It was breaking for someone else at blog 10, which became WP_110 and didn't show up... This was a couple months ago and we fixed him manually, and I don't know of anyone else who had this problem.

Note: See TracTickets for help on using tickets.