MySQL shell displaying results into something like "less" - mysql

Running the following command in a remote login attempt in a MySQL shell.
show variables;
The query only shows the last 50 or so variables out of 233. I would like the result to be scrollable so that I can review all of the variables. Something like a redirect to 'less.'
As it is, I am stumped.

You could try using the following command to set a "less"-type of behavior in the MySQL command line:
pager less
Also, this behavior can be turned off by using this command:
pager
(Note: This might not work on every flavor of MySQL... for more information, check the docs.)

Related

MySQL command line not doing anything

I'm completely new to SQL and am following the MySQL tutorial for set up. In the command line client, none of the commands seem to do anything except give me an arrow -> which just sits there. I've tried the SHOW DATABASES and CREATE DATABASE test commands and nothing. The only thing that seems to do anything is the \c command which removes the arrow and takes me back to the mysql> prompt. This is an example of what it looks like:
You need to terminate the command with a semicolon (;).

"\G" failed to work in my navicat console

"\G" failed to work in my navicat console. How do I use "\G" in navicat?
Using \G as a statement terminator to format results in vertical output is a feature of the mysql command line client.
I'm not a Navicat user, but it seems that it supports something they call Form View which is kind of similar.
https://www2.navicat.com/manual/online_manual/en/navicat/linux_manual/FormView.html

How to work with emacs and mysql

I'm getting the message unable to locate SQL program 'mysql' when I attempt to enter sql mode in Emacs. However, I'm able to access mysql just fine via terminal.
For the record, I'm using user and password as root, server as localhost and a database of my choosing. I just don't know why this is happening.
Ideas?
Emacs uses the directories listed in the exec-path variable to look for programs. You can add to it like so:
(add-to-list 'exec-path "/usr/local/bin")
The following shell command should give you the correct value to use:
dirname `which mysql`

No system command when using mysql from cli

Attempting to change directories, view directory contents, etc., but for some reason I don't have the system command to use the command line once I run mysql. These are the options I get:
List of all MySQL commands:
Note that all text commands must be first on line and end with ';'
? (\?) Synonym for `help'.
clear (\c) Clear the current input statement.
connect (\r) Reconnect to the server. Optional arguments are db and host.
delimiter (\d) Set statement delimiter.
ego (\G) Send command to mysql server, display result vertically.
exit (\q) Exit mysql. Same as quit.
go (\g) Send command to mysql server.
help (\h) Display this help.
notee (\t) Don't write into outfile.
print (\p) Print current command.
prompt (\R) Change your mysql prompt.
quit (\q) Quit mysql.
rehash (\#) Rebuild completion hash.
source (\.) Execute an SQL script file. Takes a file name as an argument.
status (\s) Get status information from the server.
tee (\T) Set outfile [to_outfile]. Append everything into given outfile.
use (\u) Use another database. Takes database name as argument.
charset (\C) Switch to another charset. Might be needed for processing binlog
with multi-byte charsets.
warnings (\W) Show warnings after every statement.
nowarning (\w) Don't show warnings after every statement.
Any ideas what could cause this? It seems to be possible using windows (using \!).
As stated in the MySQL documentation, the MySQL system command works only in Unix and therefore not in Windows:
http://dev.mysql.com/doc/refman/5.6/en/mysql-commands.html

What is the default mysql command timeout in Rails?

This sounds like a very simple question, but for some reason I couldn't find an answer for it anywhere.
I checked mysql server setting and it looks like there is no such a variable - for commands, it is probably up to a client:
show variables where variable_name like '%timeout%'
I'm trying to figure out when active record mysql adapter would timeout a mysql query/command if it ever would.
There are related questions, but not rails-specific: mysql Command timeout error
Thank you.