I execute following command to change password for admin user from command line: wp user update admin --user_pass="mynewpassword" --allow-root I got following error message:

WordPress database error You have an error in your SQL syntax; check
the manual that corresponds to your MySQL server version for the right
syntax to use near ''wp_poststats_visits'' at line 1 for query DROP
TABLE IF EXISTS 'wp_poststats_visits' made by
WP_CLI\bootstrap, WP_CLI\Bootstrap\LaunchRunner->process,
WP_CLI\Runner->start, WP_CLI\Runner->load_wordpress,

Information about system:

wp cli info
OS: Linux 4.13.0-38-generic #43-Ubuntu SMP Wed Mar 14 15:20:44 UTC 2018 x86_64
Shell: /bin/bash
PHP binary: /usr/bin/php7.1
PHP version: 7.1.17-0ubuntu0.17.10.1
php.ini used: /etc/php/7.1/cli/php.ini

  • 1
    I'd guess there's a plugin that's causing you grief. wp user update shouldn't have to DROP TABLE to work. Do you have a plugin installed called "poststats" or something along those lines? – Pat J Sep 28 '18 at 21:17
  • @PatJ : Yes, I have a plugin with this name. – plaidshirt Sep 30 '18 at 20:22

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.