dan dan - 1 year ago 59
MySQL Question

How do you set a default pager for the MySQL client?

I know you can set a pager in

(the client program) using e.g.
\P less
. But how would one configure
so that your pager of choice is activated whenever you start using the client?

Answer Source

To force this without having to pass parameters, you can put it in your my.cnf option file, under a [client] section (note that this is on the machine you're connecting from not to).

Something like this:

user = my_usual_user
host = my_usual_host
pager = less

If you want it to apply only to the actual mysql command, and no other applications that MySQL considers to be a 'client' (utilities like mysqldump read the [client] section too), then use [mysql] instead.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download