How to see current mySql parameters and settings

Post Reply
User avatar
Saman
Lieutenant Colonel
Lieutenant Colonel
Posts: 828
Joined: Fri Jul 31, 2009 10:32 pm
Location: Mount Lavinia

How to see current mySql parameters and settings

Post by Saman » Tue Jan 09, 2018 1:44 pm

Login to mySql server

Code: Select all

mysql -u username -p
Enter your password
Then enter following sql

Code: Select all

SELECT @@GLOBAL.innodb_data_file_path;
Now enter following command by changing LIKE part as required

Code: Select all

mysql> SHOW VARIABLES LIKE 'auto%';
Te above command returns a table such as below.

Code: Select all

+-----------------------------------------+---------------------------+
| Variable_name                           | Value                     |
+-----------------------------------------+---------------------------+
| auto_increment_increment                | 1                         |
| auto_increment_offset                   | 1                         |
| autocommit                              | ON                        |
| automatic_sp_privileges                 | ON                        |
You can also see Global and Session variables as below.

Code: Select all

SHOW SESSION VARIABLES LIKE 'max_join_size';
SHOW GLOBAL VARIABLES LIKE '%size%';
Post Reply

Return to “PHP & MySQL”