# Percona's mysql client horizontally wraps long queries, how to disable

**URL:** https://forums.percona.com/t/perconas-mysql-client-horizontally-wraps-long-queries-how-to-disable/35174
**Category:** MySQL & MariaDB
**Tags:** mysql
**Created:** [November 21, 2024, 3:54pm UTC](https://forums.percona.com/t/perconas-mysql-client-horizontally-wraps-long-queries-how-to-disable/35174 "2024-11-21T15:54:18Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![alh](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/alh/32/19051_2.png) [@alh](https://forums.percona.com/u/alh)
#### Post date: [November 21, 2024, 3:54pm UTC](https://forums.percona.com/t/perconas-mysql-client-horizontally-wraps-long-queries-how-to-disable/35174/1 "2024-11-21T15:54:18Z")

</div>

Howdy folks.

With Percona 8.0.34-26’s mysql client, queries that are longer than the terminal width get horizontally wrapped rather than vertically wrapped when pulling them from history with the up arrow. I cannot find a way to turn this off, and it’s really frustrating. The normal mysql client that ships with ubuntu/debian does not appear to do this.

It’s maybe related to Percona’s mysql linking to its own libreadline / libncurses, but I’m not sure.

Does anyone know how to turn off this behaviour?

Thanks.

---

<div class="post-metadata">

### Author: ![Agustin\_G](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/agustin_g/32/14111_2.png) [@Agustin\_G](https://forums.percona.com/u/Agustin_G)
#### Post date: [November 21, 2024, 10:55pm UTC](https://forums.percona.com/t/perconas-mysql-client-horizontally-wraps-long-queries-how-to-disable/35174/2 "2024-11-21T22:55:13Z")

</div>

Hi @alh,

This is indeed due to your readline configuration. You can test the following:

```auto
echo "set horizontal-scroll-mode off" >> ~/.inputrc

```

And then connect using the mysql client again. This should solve your issues.

Check if there is anything in an alreadly-existing .inputrc file, maybe, that’s overriding the default behavior in the environment where you set up your Percona Server.

---

<div class="post-metadata">

### Author: ![alh](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/alh/32/19051_2.png) [@alh](https://forums.percona.com/u/alh)
#### Post date: [November 21, 2024, 10:58pm UTC](https://forums.percona.com/t/perconas-mysql-client-horizontally-wraps-long-queries-how-to-disable/35174/3 "2024-11-21T22:58:28Z")

</div>

> [@Agustin\_G](#):
>
> `echo "set horizontal-scroll-mode off" >> ~/.inputrc`

I wish that were so. But this does _not_ happen with the debian mysql client, only with the percona mysql client, and changing this setting has no affect on it.

---

<div class="post-metadata">

### Author: ![alh](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/alh/32/19051_2.png) [@alh](https://forums.percona.com/u/alh)
#### Post date: [November 21, 2024, 11:30pm UTC](https://forums.percona.com/t/perconas-mysql-client-horizontally-wraps-long-queries-how-to-disable/35174/4 "2024-11-21T23:30:55Z")

</div>

FWIW it’s repeatable (for me) by downloading [https://downloads.percona.com/downloads/Percona-Server-LATEST/Percona-Server-8.0.34-26/binary/tarball/Percona-Server-8.0.34-26-Linux.x86\_64.glibc2.17-minimal.tar.gz](https://downloads.percona.com/downloads/Percona-Server-LATEST/Percona-Server-8.0.34-26/binary/tarball/Percona-Server-8.0.34-26-Linux.x86_64.glibc2.17-minimal.tar.gz), unpacking it, and running ./bin/mysql

---

<div class="post-metadata">

### Author: ![Agustin\_G](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/agustin_g/32/14111_2.png) [@Agustin\_G](https://forums.percona.com/u/Agustin_G)
#### Post date: [November 22, 2024, 2:55am UTC](https://forums.percona.com/t/perconas-mysql-client-horizontally-wraps-long-queries-how-to-disable/35174/5 "2024-11-22T02:55:49Z")

</div>

Strange. I tried with that binary also, and still can’t reproduce. I’m testing on Rocky linux 8.9.

I suggest you to try with strace, and compare a run using Percona Server one and another using the upstream one.

For example, use the binary you downloaded from Percona:

```auto
strace -f -s8192 -yy -ttt -o/tmp/run1_percona_server.out ./bin/mysql

```

CTRL-D or exit the client, and then try another run with upstream:

```auto
strace -f -s8192 -yy -ttt -o/tmp/run2_upstream.out mysql

```

I would grep by the configuration name I sent above. If you get nothing from it, then I would inspect which files are being read to see if any of them have leads on this.

Quick test from my side:

```auto
[root@node0 /]# echo "set horizontal-scroll-mode off" > ~/.inputrc
[root@node0 /]# strace -f -s8192 -yy -ttt -o/tmp/run1_percona_server.out mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 22
Server version: 8.0.34-26 Percona Server (GPL), Release 26, Revision 0fe62c85
...output trimmed...
mysql> exit
[root@node0 /]# cat /tmp/run1_percona_server.out | grep horizontal
5870 1732243884.467454 read(4</root/.inputrc>, "set horizontal-scroll-mode off\n", 31) = 31

```

```auto
[root@node0 /]# echo "set horizontal-scroll-mode on" > ~/.inputrc
[root@node0 /]# strace -f -s8192 -yy -ttt -o/tmp/run2_percona_server.out mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 23
Server version: 8.0.34-26 Percona Server (GPL), Release 26, Revision 0fe62c85

Copyright (c) 2009-2023 Percona LLC and/or its affiliates
Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

<1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1);^C
^C
mysql> exit
Bye
[root@node0 /]# cat /tmp/run2_percona_server.out | grep horizontal
5877 1732243972.545869 read(4</root/.inputrc>, "set horizontal-scroll-mode on\n", 30) = 30

```

Hope this helps.

---

<div class="post-metadata">

### Author: ![alh](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/alh/32/19051_2.png) [@alh](https://forums.percona.com/u/alh)
#### Post date: [November 22, 2024, 2:16pm UTC](https://forums.percona.com/t/perconas-mysql-client-horizontally-wraps-long-queries-how-to-disable/35174/6 "2024-11-22T14:16:41Z")

</div>

Thanks, I’d tried strace before and found that inputrc is not being loaded. After some more playing I think I tracked down what’s going on - it’s related to which TERM my terminal is presenting as.

If I use rxvt-unicode (with TERM=rxvt-unicode-256color), inputrc isn’t even read. How bizarre.

So no inputrc is being applied (and so I would expect default non-horizontal-scrolling behaviour). It’s a bummer that the stock mysql client works, but the percona provided one doesn’t. The big differences here seem to be percona mysql’s use of libedit/libncurses perhaps.

With that in mind, by default on my Ubuntu system, both xterm and gnome-terminal behave incorrectly with percona, unless I set TERM=vte or TERM=xterm-color, etc…

This feels like a difference in behaviour to me that could be fixed in the percona mysql, since it’s not behaviour that’s there in mysql, but once we start talking termcaps/terminfo I’ll admit I really have no idea what’s going on.

Anyway thanks for the tip, it helped.

Cheers.

---

<div class="post-metadata">

### Author: ![alh](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/alh/32/19051_2.png) [@alh](https://forums.percona.com/u/alh)
#### Post date: [November 22, 2024, 2:28pm UTC](https://forums.percona.com/t/perconas-mysql-client-horizontally-wraps-long-queries-how-to-disable/35174/7 "2024-11-22T14:28:49Z")

</div>

Ahah! Okay I’ve cracked it. The installed libcurses on my system searches all of:

- /etc/terminfo/
- /lib/terminfo/
- /usr/share/terminfo/

On Debian/Ubuntu, most of the terminfo files appear to be in /lib/terminfo

The percona mysql only searches:

- /etc/terminfo/
- /usr/share/terminfo/

So it’s not finding any of the terminfo data, and so horizontal scroll is being used instead of the expected vertical scroll!

This fixes it for me:

```auto
TERMINFO_DIRS=/etc/terminfo:/lib/terminfo:/usr/share/terminfo ./bin/mysql ...

```

---

<div class="post-metadata">

### Author: ![Agustin\_G](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/agustin_g/32/14111_2.png) [@Agustin\_G](https://forums.percona.com/u/Agustin_G)
#### Post date: [November 22, 2024, 2:41pm UTC](https://forums.percona.com/t/perconas-mysql-client-horizontally-wraps-long-queries-how-to-disable/35174/8 "2024-11-22T14:41:34Z")

</div>

Awesome detective work! 🙂

You can submit a bug for it, referencing this thread.

---

<div class="post-metadata">

### Author: ![alh](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/alh/32/19051_2.png) [@alh](https://forums.percona.com/u/alh)
#### Post date: [November 22, 2024, 2:58pm UTC](https://forums.percona.com/t/perconas-mysql-client-horizontally-wraps-long-queries-how-to-disable/35174/9 "2024-11-22T14:58:47Z")

</div>

Thanks, I’ve filed [Jira](https://perconadev.atlassian.net/browse/DISTMYSQL-481)

---

<div class="post-metadata">

### Author: ![Vadim\_Yalovets](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/vadim_yalovets/32/43_2.png) [@Vadim\_Yalovets](https://forums.percona.com/u/Vadim_Yalovets)
#### Post date: [November 22, 2024, 4:21pm UTC](https://forums.percona.com/t/perconas-mysql-client-horizontally-wraps-long-queries-how-to-disable/35174/10 "2024-11-22T16:21:31Z")

</div>

Hi @alh,

Could you clarify which operating system is used for your environment?  
The mentioned tarball is build on RedHat but you referred Debian/Ubuntu in the last reply.

---

<div class="post-metadata">

### Author: ![alh](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/alh/32/19051_2.png) [@alh](https://forums.percona.com/u/alh)
#### Post date: [November 22, 2024, 4:39pm UTC](https://forums.percona.com/t/perconas-mysql-client-horizontally-wraps-long-queries-how-to-disable/35174/11 "2024-11-22T16:39:23Z")

</div>

It’s on Debian Bookworm

---

<div class="post-metadata">

### Author: ![alh](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/alh/32/19051_2.png) [@alh](https://forums.percona.com/u/alh)
#### Post date: [December 16, 2024, 5:55pm UTC](https://forums.percona.com/t/perconas-mysql-client-horizontally-wraps-long-queries-how-to-disable/35174/12 "2024-12-16T17:55:42Z")

</div>

Annoyingly, my fix works for TERM=“rxvt-unicode-256color” but not TERM=“xterm-256color” even though there is a terminfo file for xterm-256color…
