customize keybinding in mysql cli GNU Readline

pre

when use mysql in linux, the keybinding doesn’t behave like what it does in the common zsh.

in zsh, I customize some keybinding, like use C-j/k two move between word.

1
2
bindkey "^K" forward-word
bindkey "^J" backward-word

however I found it breaks in the mysql.
and, actually it breaks in many applications, like python cli.

solution

then I found the ~/.inputrc
it will affect all applications that use GNU Readline library.
which mysql cli is of course be affected by this.

1
2
3
vim `~/.inputrc`
"\C-j": backward-word
"\C-k": forward-word