WHAT'S NEW?
Loading...

Variables in MySQL

There are three kinds of variables in MySQL

  1. System variables
  2. Status variables
  3. User variables
System variables
These variables store the configuration data required for the MySQL. They have a default value. They can be viewed by the statement:
SHOW VARIABLES;
Complete information on system variables can be found here.

Status variables
These variables show the global status of all the connections and the session status of a section. They can be viewed by the statement:
SHOW STATUS;
Complete information on status variables can be found here.

User variables
These variables have session scope. They exist for a specific session to a specific client. They start with the '@' sign. e.g. @var. Their values can be set as follows:
SET @var=5;
They are when we require a little beyond just querying the database. i.e. The user variables allow to introduce programming in the MySQL.

0 comments:

Post a Comment