How to list and delete Variables in Mysql?

Asked

Viewed 294 times

1

I know it’s a very basic question, but I can’t get a straight answer on the Internet.

I wonder how to list and delete variables in Mysql.

Ever since I thank.

  • 1

    What variables?.

  • Example if I use the SET @x = 100 command;

  • Basically eliminates with SET @var = NULL; (whole SELECT @variavelnaoexistente gives NULL a way, you will simply be reverting to the original situation)- What would be the motivation? You know it is per session (connection) that is stored right? If you need to clean all just reconnect. Mysql does not keep accumulating this information.

  • Doubt settled. Thank you very much.

1 answer

1


Basically eliminates like this:

SET @var = NULL;

you will simply be reverting the variable to the original situation (whole SELECT @variavelnaoexistente gives NULL).

The important thing is to know that it is per session (connection) that the information is kept. If you need to clear all just reconnect. Mysql does not keep accumulating this information persistently.

To list variables there is the SHOW VARIABLES (and its variations), but this only shows the predefined internal variables, whether global or session.

Considering that who "creates" the @user variables is the user himself, probably in a case of rare need, he himself can track what he created.

  • Thank you very much for the explanations;

Browser other questions tagged

You are not signed in. Login or sign up in order to post.