通常,自动完成在mysql命令行客户端(mysql-client-5.5)中工作正常.我有一张叫做预订的桌子.当我键入字母b和pres TAB时,我的表名称会自动完成:
SELECT * FROM b
但是,当我使用rlwrap(别名mysql =’/usr/bin/rlwrap -s 99999 -a -pRED /usr/bin/mysql’)时,自动完成功能停止工作.
看起来好像rlwrap干扰了自动完成功能.
我正在使用Debian Wheezy.
更新1:
当我用strace开始我的命令时,即:
strace /usr/bin/rlwrap -s 99999 -a -pRED /usr/bin/mysql --auto-rehash
我看到以下错误
access("/usr/share/rlwrap/completions/mysql", R_OK) = -1 ENOENT (No such file or directory)
可能是,rlwrap需要一些带有mysql完成的文件吗?
更新2
好的,我已经创建了文件/usr/share / rlwrap / completions / mysql并在那里放了3个样本行:
select
from
where
现在,当我启动mysql并输入sele< TAB>时,该选项卡实际上完成了单词select.这是进步,但这并不能解决整个问题.我主要需要自动完成来帮助我完成我不想(想)记住的模糊表名.但是每次更改/添加/重命名表时,我都无法编辑自动完成文件.
是不是可以告诉rlwrap使用与mysql相同的自动完成文件? (我认为mysql必须使用一些这样的文件)
更新3:
以下是strace的其他错误
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
stat("/home/martin/.terminfo", 0x7fff27ee6a70) = -1 ENOENT (No such file or directory)
access("/etc/terminfo/x/xterm-256color", R_OK) = -1 ENOENT (No such file or directory)
access("/home/martin/.mysql_completions", R_OK) = -1 ENOENT (No such file or directory)
access("/usr/share/rlwrap/completions/mysql", R_OK) = -1 ENOENT (No such file or directory)
connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
stat("/home/martin/.inputrc", 0x7fff27ee7710) = -1 ENOENT (No such file or directory)