[Ma-linux] specifying unbuffered queries from inside mysql (weird mysql question)

greg pryzby greg at pryzby.org
Tue Jan 22 16:00:20 EST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

maybe break the query for faster results

select [aA]* from ....;
select [bB]* from ....;

Don't recall if that will work, but maybe it will

Rob Sherwood wrote:
> Hello,
> 
> I have been given remote access to a database as part of my research.
> I have a remote login to the database machine (heavily secured,
> firewalled off from the rest of the world).  I don't even have shell
> access[1] - just a mysql prompt (I'm assuming /usr/bin/mysql is my
> shell).
> 
> My problem is that I want to slurp up all of the data in one particular
> database in this setting.  My basic (hackish) plan is to `select * from
> db` to write the data to stdout and just use `script` to capture it.
> The problem is the database I'm dumping is huge, and by default mysql
> buffers the query response for select, so I get no output for a really
> long time (as the database puts the query together) and the ssh
> connection is killed before the response can come back.  I've enabled
> TCPKeepAlive on ssh to attempt to avoid this problem, but the real
> issue is the query buffer.
> 
> If this were a normal situation, apparently running `mysql --quick`
> will solve this problem, i.e., it will turn off query buffering.
> However, I'm already in the mysql prompt, so can't add --quick to the
> command line.  The question is (and I've RTFM'd and failed to find the
> answer) : does anyone know if there is a way of setting the --quick
> mode from within the mysql prompt?
> 
> I realize a number of these problems could be solved by contacting the
> administrator and working out a better way for me to access the data.
> However, the admin is doing me a big favor (and is extremely busy) so I
> want to make sure I exhaust all options before bugging him more.
> 
> Thanks in advance,

- --
greg pryzby                              greg at pryzby dot org
fingerprint: 8A1A DB90 869F 5DD1 D6E9 EEB6 C156 6B04 849F A86F
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHlllkwVZrBISfqG8RArdTAJ978owEPmg+MsXXMu/nOmCxE/uB+gCfRGlM
SNqG5lZF8VDz199jNCDX80o=
=lCfy
-----END PGP SIGNATURE-----



More information about the Ma-linux mailing list