Autocompletion in the MySQL command-line client

Alan B. Dee picture Alan B. Dee · Nov 30, 2011 · Viewed 43.3k times · Source

In Linux, and many other systems, when navigating the terminal you can press Tab to auto complete a directory or file name.

I'm wondering if there is anything like that in the MySQL terminal. For example, if I want to get the description of someTableWithRidiculousLongName I could type describe someTableW then Tab and it would auto-complete the rest.

Does anything like that exist in the MySQL terminal?

Answer

T Zengerink picture T Zengerink · Mar 16, 2012

Edit or create a file called .my.cnf in your home directory, containing:

[mysql]
auto-rehash