如何为MySQL客户端设置默认寻呼机? [英] How do you set a default pager for the MySQL client?

查看:81
本文介绍了如何为MySQL客户端设置默认寻呼机?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道您可以使用以下命令在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆