Opened 20 years ago
Closed 20 years ago
#2435 closed defect (bug) (invalid)
Changing table prefix in wp-config doesn't update database
| Reported by: | MtDewVirus | Owned by: | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | Administration | Version: | 2.0.1 |
| Severity: | normal | Keywords: | table prefix database rename update |
| Cc: | Focuses: |
Description
Changing the table prefix in wp-config.php doesn't update the database.
xx_user_level and xx_capabilities in table xx_usermeta are created with xx being the table prefix. The same with xx_user_roles in table xx_options.
When updating the table prefix, these names are not updated, so WP cannot read user permissions. After manually renaming them, permissions worked again.
Change History (2)
#2
@
20 years ago
- Resolution → invalid
- Status new → closed
Should it? How should it? The prefix is not stored in a setting so WP has no memory of it. Alas, changing the prefix makes WP load a different set of tables, so it wouldn't be able to see the old setting anyway unless you had manually renamed or moved the tables...
You might want to write a script that completes the move to a new prefix but this isn't something WP needs IMO.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
We could detect a table prefix that isn't consistent with a table_prefix option in the DB, and update those options if they don't match up.