Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've got tab completion working for tables and columns (--auto-rehash), is there any way to also have tab completion for SQL commands eg

SE (tab) --> SELECT
SELECT * FR (tab) --> SELECT * FROM
share|improve this question
    
stackoverflow question? – ricbax Oct 6 '10 at 2:52
    
I'm not sure what your interface is. Is this some kind of MySQL client software, or the command line perhaps? – NReilingh Oct 6 '10 at 3:20
    
Looks like the stock mysql client program to me. – Ignacio Vazquez-Abrams Oct 6 '10 at 4:11
up vote 1 down vote accepted

You're probably talking about mysql command-line client.

For a single session, you can enable tab completion with command line switch --auto-rehash .

To set this behavior default, check your mysql configuration file my.cnf, find [mysql] region, and replace line

no-auto-rehash

with

auto-rehash
share|improve this answer
    
ahh, SQL commands must be typed in caps for autocompletion to work – cerberos Nov 28 '12 at 11:59
1  
Not working for me. Something to do with vi key binding? – Frozen Flame Aug 24 '15 at 7:58
1  
@FrozenFlame: I found the solution to this problem (which was what I was looking for when I found this answer) on Stack Overflow stackoverflow.com/questions/2216471/… – adam_0 May 5 at 22:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .