Looking for a hack: share data between MySQL sessions

I’m looking for a way to share data between two MySQL connections/sessions. Obviously tables are the trivial answer, but for reasons of security (possibly insufficient privileges) I wish to avoid that.

The type of data to be passed can vary. Ideally I would be able to pass multiple pieces of information (dates, texts, integers, etc.) around. If impossible, I would do with texts only, and if impossible yet, I could do with a single text (but reasonably long).

There is a way to do so: by writing to the file system (SELECT INTO OUTFILE + LOAD_FILE()). However I wish to avoid it, since writing to files from within MySQL requires creation of a new file each time; no overwrite and no purging; this litters the file system.

So: any other tricks? Is there some way to pass data via GET_LOCK()/RELEASE_LOCK() (none that I can see other than Morse code)?

Is there some global variable that is unused, can be changed dynamically, and has enough space? (I couldn’t find one)

I appreciate any input.

20 thoughts on “Looking for a hack: share data between MySQL sessions

  1. @combuilder,

    So the Stored Routines lib can dynamically get and set global variables — but that doesn’t help too much because those global variables have some important value, that I should not be tampering with.

  2. Well, securty concerns about IPC are even harder, since the data are less defined than the tables.
    So I don’t think you’ll be saving anything with avoiding the tables.

    But if that must be done your option is to write a daemon plugin that has (any number of) global variables that processes can use to pass data around.
    If you couple that with GET_LOCK() it may work.

    But this will require super priv to set the global.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.