开发者

Mysql on the command line (can't use all keyboard buttons)

Using mysql directly from the command line (running on Ubuntu 9.10, standard bash terminal), I am unable to use certain keyboard buttons like:

Delete, Control-(arrow right), Control-(arrow left)

Which gets returned to me as:

~;5C;5D

respectively. I'm assuming there must be a flag i开发者_高级运维n mysql that fixes this but I have been unable to find one. Is there a .mysqlconfig file to edit to make this happen on startup?


According to this thread and mysql --version, mysql is compiled with editline instead of readline. From that thread:

I had to add create an .editrc file with the following lines to get ctrl-R and DELETE to work.

bind "\e[3~" ed-delete-next-char 
bind "^R" em-inc-search-prev

Although that didn't work for me.

Another suggestion from that thread did work:

$ sudo apt-get install rlwrap

Then add an alias in ~/.bashrc

alias mysql='rlwrap -a mysql'

This problem may be specific to Ubuntu 9.10

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜