-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ERROR at line 1: Unknown command '\-'. When trying to import with - #254
Comments
Downgrading to 2.8.1 on all 3 sides did not help. What file? It's not by bash script, as the same error appears when I run this run console. If this is an error from WP-CLI it would for sure be helpful to know what file this is referring to. |
|
That error comes from MySQL / MariaDB itself and indicates an issue with the .sql file. Since there are two servers involved and there is only version info for one of them, I'm not sure but this recent bug might be relevant if you are exporting from a newer version into an older one: https://jira.mariadb.org/browse/MDEV-34183 Otherwise searching for that error message brings up other possibilities. |
@mrsdizzie Thanks so much! Upgrading MariaDB in my VM did the trick. I figured it something on my end, probably nothing to do with WP-CLI directly. I made a simple check of the end of the MySQL file, I assume it was/is perfectly fine. Seems it was the bug you mentioned. https://jira.mariadb.org/browse/MDEV-34183 @wp-cli devs if you could please add some kind of hint to error messages coming from mysql. I thought it has something to do with the Error messages that say nothing helpful and do not even tell you where they are coming from are a nightmare. |
Often MySQL errors do identify themselves better (or are more obvious) like: Line 1729 in bf741eb
so $send_to_shell is false. Otherwise it will directly exit here:https://github.com/wp-cli/wp-cli/blob/f701f406aa39f6aeca2af16e92712780e2675bad/php/utils.php#L587-L589 That of course will also change existing output which would be a breaking change etc... A less breaking option would be to add a |
I think we'll refrain from the breaking change for now. We can revisit in the future if it comes up again. Thanks for the report, @nextgenthemes ! |
Bug Report
Describe the current, buggy behavior
I have been using this command in a script for years. No idea WTF is happening, I need to - to pipe a local file to the remote.
Export works perfectly fine
wp @prod db export - > "$sql_file"
Describe what you would expect as the correct outcome
No error, like it always did.
Let us know what environment you are running this on
The text was updated successfully, but these errors were encountered: