Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 593
Alan B. Dee Avatar asked Nov 30 '11 20:11

Alan B. Dee


People also ask

How to get auto suggestion in MySQL workbench?

The SQL Editor offers autocomplete functionality by either pressing the keyboard shortcut (Modifier + Space), or it will start automatically if the Automatically Start Code Completion preference is enabled.

How do I run MySQL shell?

Enter mysql.exe -uroot -p , and MySQL will launch using the root user. MySQL will prompt you for your password. Enter the password from the user account you specified with the –u tag, and you'll connect to the MySQL server.


1 Answers

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

[mysql] auto-rehash 
like image 175
T. Zengerink Avatar answered Oct 13 '22 05:10

T. Zengerink