dan dan - 7 months ago 19
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?


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.