如何为MySQL客户端设置默认寻呼机? [英] How do you set a default pager for the MySQL client?
问题描述
我知道您可以使用以下命令在mysql
(客户端程序)中设置传呼机\P less
.但是如何配置mysql
,以便在您开始使用客户端时激活您选择的寻呼机?
I know you can set a pager in mysql
(the client program) using e.g. \P less
. But how would one configure mysql
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).
类似这样的东西:
[client]
user = my_usual_user
host = my_usual_host
pager = less
如果您希望它仅将 应用于实际的mysql
命令,并且没有其他被MySQL视为客户端"的应用程序(如mysqldump
这样的实用程序,请阅读[client]
部分),然后改用[mysql]
.
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.
这篇关于如何为MySQL客户端设置默认寻呼机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!