I would like to use tab completion when using the MySQL REPL accessed by running wp db cli. However it doesn't seem to work, even though my ~/.my.cnf file contains this content:


If I use the mysql command directly, tab completion does work.

Running wp db cli --defaults doesn't seem to fix the problem.

  • 1
    As a workaround, type \# and press enter in the MySQL REPL. That should enable tab completion.
    – Flimm
    Feb 8 at 15:37

1 Answer 1


WP-CLI turns it off by default in order to improve performance.

You can manually enable it by running wp db cli --auto-rehash. That's not very convenient, though, so a better way is to add it to your custom configuration file:

# Global parameters: https://make.wordpress.org/cli/handbook/config/#global-parameters
path: public_html/wordpress

# DB parameters
db cli:
  auto-rehash: 1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.