I'd like to add a couple of command-line arguments to my Django's ./manage.py dbshell command, and I can't figure out how.

In specific I'd like to add -A to prevent MySQL from scanning every table and every column, and --prompt=LOCAL: since I frequently keep multiple shells open.

I can't figure out how to do this! I'm only idea is to create my own "mysql" command in /usr/local/bin and have it be a wrapper for mysql with my own flags. But I'd really like to avoid doing that.


No, there is no direct way to do this.

You need to modify the code django/db/backends/mysql/client.py. Don't worry, it is eay.

  • 1
    this reads more like a comment, see How to Answer
    – gnat
    May 21 '15 at 4:53
  • "No, it cannot be done" is very much an answer. And it even explains how to achieve it. Upvoted. Jul 2 '15 at 18:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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