Closed bgturner closed 3 years ago
I also just experienced this with https://all-inkl.com/ hosting. --defaults
does not help.
Problem also seems to be that the socket as defined in /etc/mysql/my.cnf
is not being picked up.
As a quick workaround adding a --socket=/path/to/mysqld.sock
to each command works, but doesn't feel like a long term stable solution.
If I can provide any further information to help let me know.
@bgturner, @kraftner Can you test with the latest nightly (wp cli update --nightly
) to see if this issue is resolved?
Sorry, it seems as if the hoster fixed the issue on their side in the meantime. Since I can't reproduce the original issue I also can't check if your fix solved it, sorry! :disappointed:
Thanks for taking a crack at this @schlessera ! It looks like the clean
command works -- the tables were nuked!
drop
create
and reset
are still having issues:
Here's a recorded screencast of me doing the QA in case it helps give more context:
It seems that the problem happens when running wp config create
too.
Seeing this with wp config create
, it won't accept --defaults
Bug Report
Describe the current, buggy behavior
When using wpcli in an environment that needs the
--defaults
flag (like Local ), theclean
,create
,drop
, andreset
subcommands are not working.When running these commands, I get this error within the terminal:
The problem is that the above socket (
/tmp/mysql.sock
) isn't the correct one for the environment. Here are some details from my site's terminal session:Describe how other contributors can replicate this bug
You might be able to replicate by having a custom MySQL config and using the
--defaults
flag, but the easiest way I know is to use Local:clean
,create
,drop
, orreset
Describe what you would expect as the correct outcome
I would expect that all
db
subcommands should work by being able to use the same socket connection.Let us know what environment you are running this on
Provide a possible solution
Taking a look at those functions that produce errors, it seems like maybe they need to be refactored to not use
$this->run_query(...
I'm new to the wpcli project, so I might see if I can get something working, but if anyone has pointers, I'd love to learn more!
Provide additional context/Screenshots
It looks like this is related to the with the work done in #157 however, a few subcommands weren't covered.