gpt4 book ai didi

命令行下的Mysql(不能用所有的键盘按键)

转载 作者:行者123 更新时间:2023-11-29 01:02:31 25 4
gpt4 key购买 nike

直接从命令行使用 mysql(在 Ubuntu 9.10 上运行,标准 bash 终端),我无法使用某些键盘按钮,例如:

删除,Control-(右箭头),Control-(左箭头)

返回给我的是:

~;5C;5D

分别。我假设 mysql 中必须有一个标志来解决这个问题,但我一直找不到。是否有要编辑的 .mysqlconfig 文件以使其在启动时发生?

最佳答案

根据 this threadmysql --version,mysql 是用 editline 而不是 readline 编译的。从那个线程:

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

虽然这对我不起作用。

该线程的另一个建议确实有效:

$ sudo apt-get install rlwrap

然后在~/.bashrc中添加别名

alias mysql='rlwrap -a mysql'

这个问题可能是 Ubuntu 9.10 特有的

关于命令行下的Mysql(不能用所有的键盘按键),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2103793/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com