wp-cli: WordPress database error Unknown column 'Tables_in_' during search-replace
Hi all,
using version 1.5, in a multisite installs with wp-content in custom location, if i try to launch
wp search-replace something someone
i get this error
WordPress database error Unknown column 'Tables_in_' in 'where clause' for query SHOW TABLES WHERE Tables_in_ IN [...]
About this issue
- Original URL
- State: open
- Created 6 years ago
- Reactions: 3
- Comments: 24 (7 by maintainers)
Just to drop some notes in here for how I’m dealing with this issue (hyperdb in my case, should be applicable elsewhere):
--all-tables/--all-tables-with-prefixboth work with the optional<table>arg(s), as well as--urlflag.--all-tables/--all-tables-with-prefixis effectively a broader scope that will be narrowed down by the other parameters.I know it’s not ideal, but it gets the job done in the meantime.
single-site
either
--all-tablesflag works for me (there are some nuances, check the docs). If I need to restirct, I can specify a table. This isn’t much different the normal usage.not-main-site of multisite
I’ll do one of two things:
--all-tables-with-prefixcombined with--url. The url sets the context, so the prefix will be something likewp_12_. This effectively restricts the command to the child site.--all-tableswith wildcard<table>arg (e.g.wp search-replace old new wp_12_* --all-tables). Note:--all-tables-with-prefixwill also work, as without--urlthe prefix is justwp_.Again, neither are terribly different than normal usage.
main site of multisite
This is the odd ball. Because the main site doesn’t have a unique prefix, you pretty much have to specify a table list.
wp search-replace old new wp_posts wp_postmeta wp_options... --all-tablesHi all, we use HyperDB on a number of sites with multisite and keep running into this issue. It would be terrific to get it fixed.
resolved, I have to add
--all-tables, or specify the blogs. https://make.wordpress.org/cli/Would be great to get this one resolved if at all possible. I had the same issue again today.
Experiencing this issue with WordPress VIP. Any updates?
Another HyperDB user here facing this same issue and it’s going to force me to write a lot of extra scripting – is this fixable?
Thanks @gitlost