MySQL Tutorial
Introduction Installation of MySQL Getting MySQL server information RDBMS Concepts Data Definition Language Data types Managing Databases Managing Tables Managing Views Inserting records in a table Updating records in a table Deleting records from a table Retrieving Records Data Control Language Variables in MySQL Procedures in MySQL Built-In functions in MySQL User Defined functions in MySQL Triggers in MySQL Cursors in MySQL Transaction control Event scheduler Tuning MySQL Server Performance Managing users Importing and Exporting data Database Testing Workbench PHPMyAdminVariables in MySQL
There are mainly three types of variables in MySQL.- User variables (prefixed with @)
- System Variables (prefixed with @@)
- Local Variables (No prefix)
SET @myvar = 1;
select @myvar;
Example on System variables are given below.
select @@autocommit;
We can view all System variables using below syntax.
SHOW VARIABLES
SHOW VARIABLES LIKE ‘%a%’;
System variables are further categorized in Global and Session. Global variables impact entire server. While session variables impact only session.
SET GLOBAL sort_buffer_size=200000;
SET SESSION sort_buffer_size=200000;
Example on Local variables are given below.
DECLARE myid INT DEFAULT 0;
Web development and Automation testing
solutions delivered!!