Alan B. Dee Alan B. Dee - 5 months ago 32
SQL Question

Autocompletion in the MySQL command-line client

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

start MySQL console with additional option --auto-rehash, i.e.

mysql --auto-rehash -u root -p