安装下rlwrap,最新版本是0.43
下载地址 https://fossies.org/linux/privat/rlwrap-0.43.tar.gz/
```
安装rlwrap
tar -zxvf rlwrap-0.43.tar.gz
[root@openguess soft]# ll
total 298864
-rw------- 1 omm dbgrp 1234 Apr 8 10:30 cluster_config_opendb.xml
drwx------. 15 root root 4096 Apr 8 10:32 lib
drwxr-xr-x. 4 omm dbgrp 30 Apr 8 10:32 openGauss
-r--------. 1 root root 101382908 Apr 7 15:39 openGauss-2.0.0-CentOS-64bit-all.tar.gz
-r--------. 1 root root 65 Mar 31 21:16 openGauss-2.0.0-CentOS-64bit-om.sha256
-r--------. 1 root root 12646330 Mar 31 21:16 openGauss-2.0.0-CentOS-64bit-om.tar.gz
-r--------. 1 root root 65 Mar 31 21:16 openGauss-2.0.0-CentOS-64bit.sha256
-r--------. 1 root root 89573052 Mar 31 21:16 openGauss-2.0.0-CentOS-64bit.tar.bz2
-r-------- 1 root root 101944654 Apr 8 10:32 openGauss-Package-bak_78689da9.tar.gz
drwxrwxr-x 8 asas asas 323 Mar 3 2017 rlwrap-0.43
-rw-r--r-- 1 root root 313139 Jul 24 2020 rlwrap-0.43.tar.gz
drwx------. 6 root root 4096 Mar 31 21:16 script
drwxr-xr-x. 2 root root 4096 Mar 31 21:16 simpleInstall
-r--------. 1 root root 65 Mar 31 21:15 upgrade_sql.sha256
-r--------. 1 root root 133704 Mar 31 21:15 upgrade_sql.tar.gz
-r-------- 1 root root 32 Mar 31 21:14 version.cfg
[root@openguess soft]# mv rlwrap-0.43 /usr/local/rlwrap
[root@openguess soft]# cd /usr/local/rlwrap/
[root@openguess rlwrap]# ll
total 448
-rw-rw-r-- 1 asas asas 42141 Mar 3 2017 aclocal.m4
-rw-rw-r-- 1 asas asas 910 Mar 2 2017 AUTHORS
-rw-rw-r-- 1 asas asas 2965 Aug 30 2016 BUGS
-rw-rw-r-- 1 asas asas 105 Aug 30 2016 ChangeLog
drwxrwxr-x 2 asas asas 38 Mar 3 2017 completions
-rw-rw-r-- 1 asas asas 8682 Mar 3 2017 config.h.in
-rwxrwxr-x 1 asas asas 250121 Mar 3 2017 configure
-rw-rw-r-- 1 asas asas 18451 Mar 3 2017 configure.ac
-rw-rw-r-- 1 asas asas 17992 Aug 30 2016 COPYING
drwxrwxr-x 2 asas asas 65 Mar 3 2017 doc
drwxrwxr-x 2 asas asas 4096 Mar 3 2017 filters
-rw-rw-r-- 1 asas asas 4083 Feb 13 2017 INSTALL
-rw-rw-r-- 1 asas asas 1838 Feb 26 2017 Makefile.am
-rw-rw-r-- 1 asas asas 41793 Mar 3 2017 Makefile.in
-rw-rw-r-- 1 asas asas 22209 Mar 2 2017 NEWS
-rw-rw-r-- 1 asas asas 1398 Feb 12 2017 PLEA
-rw-rw-r-- 1 asas asas 3113 Jan 30 2017 README
drwxrwxr-x 2 asas asas 308 Mar 3 2017 src
drwxrwxr-x 2 asas asas 38 Mar 3 2017 test
-rw-rw-r-- 1 asas asas 236 Sep 4 2016 TODO
drwxrwxr-x 2 asas asas 126 Mar 3 2017 tools

[root@openguess rlwrap]# ./configure -q
Will rlwrap find command's working directory under /proc/<commands pid>/cwd? let's see...

Now do:
make (or gmake) to build rlwrap
make check for instructions how to test it
make install to install it

```
注意linux7 最小安装会报
checking for tgetent in -ltermcap... no
configure: WARNING: No termcap nor curses library found
checking for readline in -lreadline... no
configure: error:
You need the GNU readline library(ftp://ftp.gnu.org/gnu/readline/ ) to build
this program!

```
需要yum install readline-devel -y 就可以

```
make && make install
```

[root@openguess rlwrap]# make && make install
make all-recursive
make[1]: Entering directory `/usr/local/rlwrap'
Making all in doc
make[2]: Entering directory `/usr/local/rlwrap/doc'
sed -e 's#@DATADIR@#/usr/local/share#' rlwrap.man > rlwrap.1
make[2]: Leaving directory `/usr/local/rlwrap/doc'
Making all in src
make[2]: Entering directory `/usr/local/rlwrap/src'
gcc -DHAVE_CONFIG_H -I. -I.. -DDATADIR=\"/usr/local/share\" -g -O2 -MT main.o -MD -MP -MF .deps/main.Tpo -c -o main.o main.c
mv -f .deps/main.Tpo .deps/main.Po
gcc -DHAVE_CONFIG_H -I. -I.. -DDATADIR=\"/usr/local/share\" -g -O2 -MT signals.o -MD -MP -MF .deps/signals.Tpo -c -o signals.o signals.c
mv -f .deps/signals.Tpo .deps/signals.Po
gcc -DHAVE_CONFIG_H -I. -I.. -DDATADIR=\"/usr/local/share\" -g -O2 -MT readline.o -MD -MP -MF .deps/readline.Tpo -c -o readline.o readline.c
mv -f .deps/readline.Tpo .deps/readline.Po
gcc -DHAVE_CONFIG_H -I. -I.. -DDATADIR=\"/usr/local/share\" -g -O2 -MT pty.o -MD -MP -MF .deps/pty.Tpo -c -o pty.o pty.c
mv -f .deps/pty.Tpo .deps/pty.Po
gcc -DHAVE_CONFIG_H -I. -I.. -DDATADIR=\"/usr/local/share\" -g -O2 -MT completion.o -MD -MP -MF .deps/completion.Tpo -c -o completion.o completion.c
mv -f .deps/completion.Tpo .deps/completion.Po
gcc -DHAVE_CONFIG_H -I. -I.. -DDATADIR=\"/usr/local/share\" -g -O2 -MT term.o -MD -MP -MF .deps/term.Tpo -c -o term.o term.c
mv -f .deps/term.Tpo .deps/term.Po
gcc -DHAVE_CONFIG_H -I. -I.. -DDATADIR=\"/usr/local/share\" -g -O2 -MT ptytty.o -MD -MP -MF .deps/ptytty.Tpo -c -o ptytty.o ptytty.c
mv -f .deps/ptytty.Tpo .deps/ptytty.Po
gcc -DHAVE_CONFIG_H -I. -I.. -DDATADIR=\"/usr/local/share\" -g -O2 -MT utils.o -MD -MP -MF .deps/utils.Tpo -c -o utils.o utils.c
mv -f .deps/utils.Tpo .deps/utils.Po
gcc -DHAVE_CONFIG_H -I. -I.. -DDATADIR=\"/usr/local/share\" -g -O2 -MT string_utils.o -MD -MP -MF .deps/string_utils.Tpo -c -o string_utils.o string_utils.c
mv -f .deps/string_utils.Tpo .deps/string_utils.Po
gcc -DHAVE_CONFIG_H -I. -I.. -DDATADIR=\"/usr/local/share\" -g -O2 -MT malloc_debug.o -MD -MP -MF .deps/malloc_debug.Tpo -c -o malloc_debug.o malloc_debug.c
mv -f .deps/malloc_debug.Tpo .deps/malloc_debug.Po
gcc -DHAVE_CONFIG_H -I. -I.. -DDATADIR=\"/usr/local/share\" -g -O2 -MT filter.o -MD -MP -MF .deps/filter.Tpo -c -o filter.o filter.c
mv -f .deps/filter.Tpo .deps/filter.Po
gcc -DDATADIR=\"/usr/local/share\" -g -O2 -o rlwrap main.o signals.o readline.o pty.o completion.o term.o ptytty.o utils.o string_utils.o malloc_debug.o filter.o -lutil -lreadline -ltinfo
make[2]: Leaving directory `/usr/local/rlwrap/src'
Making all in filters
make[2]: Entering directory `/usr/local/rlwrap/filters'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/usr/local/rlwrap/filters'
make[2]: Entering directory `/usr/local/rlwrap'
make[2]: Leaving directory `/usr/local/rlwrap'
make[1]: Leaving directory `/usr/local/rlwrap'
Making install in doc
make[1]: Entering directory `/usr/local/rlwrap/doc'
make[2]: Entering directory `/usr/local/rlwrap/doc'
make[2]: Nothing to be done for `install-exec-am'.
/usr/bin/mkdir -p '/usr/local/share/man/man1'
/usr/bin/install -c -m 644 rlwrap.1 '/usr/local/share/man/man1'
make[2]: Leaving directory `/usr/local/rlwrap/doc'
make[1]: Leaving directory `/usr/local/rlwrap/doc'
Making install in src
make[1]: Entering directory `/usr/local/rlwrap/src'
make[2]: Entering directory `/usr/local/rlwrap/src'
/usr/bin/mkdir -p '/usr/local/bin'
/usr/bin/install -c rlwrap '/usr/local/bin'
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/usr/local/rlwrap/src'
make[1]: Leaving directory `/usr/local/rlwrap/src'
Making install in filters
make[1]: Entering directory `/usr/local/rlwrap/filters'
make[2]: Entering directory `/usr/local/rlwrap/filters'
make[2]: Nothing to be done for `install-exec-am'.
/usr/bin/mkdir -p '/usr/local/share/man/man3'
/usr/bin/install -c -m 644 RlwrapFilter.3pm '/usr/local/share/man/man3'
make[2]: Leaving directory `/usr/local/rlwrap/filters'
make[1]: Leaving directory `/usr/local/rlwrap/filters'
make[1]: Entering directory `/usr/local/rlwrap'
make[2]: Entering directory `/usr/local/rlwrap'
make[2]: Nothing to be done for `install-exec-am'.
/usr/bin/mkdir -p '/usr/local/share/rlwrap'
/usr/bin/mkdir -p '/usr/local/share/rlwrap/filters'
/usr/bin/install -c -m 644 filters/README filters/RlwrapFilter.pm filters/RlwrapFilter.3pm filters/count_in_prompt filters/pipeto filters/logger filters/null filters/unbackspace filters/pipeline filters/ftp_filter filters/handle_hotkeys filters/history_format filters/simple_macro filters/template filters/scrub_prompt filters/paint_prompt filters/censor_passwords filters/listing filters/paint_prompt.py filters/handle_hotkeys.py filters/logger.py filters/pipeto.py filters/rlwrapfilter.py filters/null.py filters/censor_passwords.py filters/count_in_prompt.py filters/ftp_filter.py '/usr/local/share/rlwrap/filters'
/usr/bin/mkdir -p '/usr/local/share/rlwrap/completions'
/usr/bin/install -c -m 644 completions/testclient completions/coqtop '/usr/local/share/rlwrap/completions'
make install-data-hook
make[3]: Entering directory `/usr/local/rlwrap'
chmod a+x /usr/local/share/rlwrap/filters/*
make[3]: Leaving directory `/usr/local/rlwrap'
make[2]: Leaving directory `/usr/local/rlwrap'
make[1]: Leaving directory `/usr/local/rlwrap'
[root@openguess rlwrap]#
```
添加环境变量
```
su - omm
vi .bashrc
alias gsql='rlwrap gsql'

```

rlwrap解决opengauss,pg,oracle上下左右及回退乱码的更多相关文章

  1. Oracle sqlplus中退格键、DEL键、上下左右键无法使用乱码问题

    功能描述:Oracle sqlplus中退格键.DEL键.上下左右键无法使用乱码 1.安装readline-8.0 ①下载readline-8.0.tar.gz文件,百度网盘下载路径: https:/ ...

  2. oracle安装界面中文乱码解决

    在安装oracle时如果我们用的是英文安装没有任何问题,但是我要安装中文的,结果中文界面就出现了乱码了,后来网上找了原因是要安装中文包才可以,下面我来介绍一下. 在Linux的X window里安装o ...

  3. 解决在Linux下安装Oracle时的中文乱码问题

    本帖最后由 TsengYia 于 2012-2-22 17:06 编辑 解决在Linux下安装Oracle时的中文乱码问题 操作系统:Red Hat Enterprise Linux 6.1数据库:O ...

  4. C#.NET ORM FreeSql 读取使用 US7ASCII 的 Oracle 数据库中文显示乱码问题

    前言 关于 Oracle US7ASCII 中文乱码的问题,Ado.Net 和 Odbc 无法解决.包括最新的.Net Core..NET6..NET7 都无法解决这个问题. FreeSql 对 Or ...

  5. [转]解决IIS下UTF-8文件报错乱码的问题

    找了两天才找到解决办法…….晕晕晕...用第二种方法解决了. 网上找到的方法都没有写这一条 If objASPError.ASPDescription > "" Then 后 ...

  6. 解决 Excel 打开 UTF-8 编码 CSV 文件乱码的 BUG

    解决 Excel 打开 UTF-8 编码 CSV 文件乱码的 BUG zoerywzhou@163.com http://www.cnblogs.com/swje/ 作者:Zhouwan 2017-6 ...

  7. Ubuntu下解决解压zip文件中文文件名乱码问题

    在Ubuntu下解压Windows下压缩的zip文件时,会出现解压出的带中文文件名的文件名乱码,这是因为Ubuntu和Windows默认的编码不同,Ubuntu下默认的编码是UTF-8,而Window ...

  8. 解决@ResponseBody注解返回的json中文乱码问题

    1. 简介 主要解决@ResponseBody注解返回的json中文乱码问题. 2.解决方案 2.1mvc加上注解(推荐此方法) 在mvc配置文件中假如下面配置(写在 <mvc:annotati ...

  9. 15、解决14中csv用excel打开乱码的问题 open('zhihu.csv','w',newline='',encoding='utf-8-sig')

    解决14中csv用excel打开乱码的问题 ,其实就是在写csv的时候把 utf-8 改成 utf-8-sig open('zhihu.csv','w',newline='',encoding='ut ...

  10. 解决pycharm左侧项目文件名中文字体乱码情况?中文显示口口口口.

    解决pycharm左侧项目文件名中文字体乱码情况?中文显示口口口口. 点击file,进入settings 出现 Appearance & Behavior 点击Appearance UI Op ...

随机推荐

  1. java中加号的用法

    注意java中+号的使用 public class Add { public static void main(String[] args) { System.out.println(100+80); ...

  2. JS 过滤数组中 对象的某个属性

    var newArray = [{name: "aaa",value: 0, height: 1},{name: "bbb",value: 1, height: ...

  3. js任务队列EventLoop

    JS 执行机制 在我们学js 的时候都知道js 是单线程的如果是多线程的话会引发一个问题在同一时间同时操作DOM 一个增加一个删除JS就不知道到底要干嘛了,所以这个语言是单线程的但是随着HTML5到来 ...

  4. 分享一般.net core的web项目发布到服务器环境的处理步骤(来自本人实践笔记)

    <步骤1:发布> <步骤2:确保已打开iis web相关功能> [注]如果未打开在按如下操作. Win7/win10通过打开或关闭windows功能. Windows2012等 ...

  5. 主题 2 Shell工具和脚本

    主题 2 Shell工具和脚本 Shell 工具和脚本 · the missing semester of your cs education (missing-semester-cn.github. ...

  6. Runloop的使用

    系统为我们提供了多种模式,下面列一些比较常遇到的: kCFRunLoopDefaultMode: App的默认 Mode,通常主线程是在这个 Mode 下运行的. UITrackingRunLoopM ...

  7. 使用Zolom内存解析运行python脚本(不落地)

    在目标机器运行python工具 好多工具都是python写的,如果目标机器是linux的话自带python环境可以很方便的运行这些工具,但是windows下是不自带python环境的,所以一种办法是直 ...

  8. 函数式编程思想概述-冗余的Runnable代码

    函数式编程思想概述 在数学中,函数就是有输入量.输出星的一套计算方案,也就是"拿什么东西做什么事情".相对而言,面向对象过分强调"必须通过对象的形式来做事情", ...

  9. Java 进阶P-2.5+P-2.6

    包 Java 包(package) 为了更好地组织类,Java 提供了包机制,用于区别类名的命名空间. 包的作用 1.把功能相似或相关的类或接口组织在同一个包中,方便类的查找和使用. 2.如同文件夹一 ...

  10. 用if语句替换三元运算符-标准的switch语句

    用if语句替换三元运算符 在某些简单的应用中,if语句是可以和三元运算符互换使用的. public static void main(String[] args) { int a = 10; int ...