6

In mysql client, it used to show possible words when I press tab. Somehow it is not working now. Is there anyway to enable it again. I'm using mysql client 5.5 in CentOS 5.5.

thavan
  • 2,409
  • 24
  • 32

1 Answers1

10

found the solution.

in my.cnf file, add

[mysql]
auto-rehash

add no-auto-rehash to disable auto completion.

thavan
  • 2,409
  • 24
  • 32
  • 1
    That's what the docs say, but this doesn't work for me at all. I've tried writing `[mysql] auto-rehash` in `my.ini` and supplying `--auto-refresh` to the `mysql` command line program, to no effect. – mcandre Mar 19 '13 at 13:42
  • @mcandre what version of my mysql server you are using? – thavan Mar 20 '13 at 02:55
  • `mysql Ver 14.14 Distrib 5.6.10, for Win32 (x86)` – mcandre Mar 20 '13 at 12:49
  • @mcandre the above solution worked well with linux. I'm not sure about windows :) – thavan Mar 21 '13 at 03:51
  • The completion in mysql client relies on the readline library, which is ubiquitous on linux/unix systems, but rarely found on windows systems. If you installed cygwin, mingwin or similar, and used the mysql shell inside those environments, you would get command completion. I'm not sure about getting a 'native' readline library for windows, but I suspect it would not help since the windows mysql client would not have been compiled against it. – sirlark May 23 '13 at 10:13
  • find my.cnf here: https://stackoverflow.com/a/56915033/8526184 – sgauri Sep 01 '20 at 04:29