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?
Use the \pager | \P command MySQL Shell command to set the value of shell . options["pager"] option. If called with no arguments, restores the initial value of shell. options["pager"] option (the one MySQL Shell had at startup.
Enter mysql.exe -uroot -p , and MySQL will launch using the root user. MySQL will prompt you for your password. Enter the password from the user account you specified with the –u tag, and you'll connect to the MySQL server.
mysql is a simple SQL shell with input line editing capabilities. It supports interactive and noninteractive use. When used interactively, query results are presented in an ASCII-table format. When used noninteractively (for example, as a filter), the result is presented in tab-separated format.
SELECT VERSION Statement It's possible to obtain the version from within the MYSQL client by typing the SELECT VERSION() statement: SELECT VERSION(); This command derives the data from the version variable disregarding other variables.
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:
[client] 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With