– Query MySQL version
select version() from dual;
-View the length of the database string splicing
show variables like 'group_concat_max_len';
-Display the maximum number of MySQL connections
show variables like '%max_connections%';
-Modify the maximum number of connections
-- set GLOBAL max_connections = 200;
-The maximum number of MySQL connections that the server responds to-the ideal setting is: Max_used_connections /
max_connections * 100% ≈ 85%
show status like '%connections%';
-View MySQL threads
show status like '%Threads%';
-To view the storage space occupied by the index in mysql, use the following sql statement
SELECT
table_name,
concat( TRUNCATE ( data_length / 1024 / 1024, 2 ), 'MB' ) AS data_size,
concat( TRUNCATE ( index_length / 1024 / 1024, 2 ), 'MB' ) AS index_size
FROM
information_schema.TABLES
WHERE
table_name = 'ec_order'
ORDER BY
index_size DESC;
– View the subdivision index of a single table:
select TABLE_SCHEMA,TABLE_NAME,COLUMN_NAME,CARDINALITY from
information_schema.STATISTICS iss
where iss.table_name='ec_order';
-Query table and index occupy space
select * from information_schema.TABLES
where information_schema.TABLES.TABLE_SCHEMA='ftms_union' and
information_schema.TABLES.TABLE_NAME='ec_order'
– Query Sql template
select @@global.sql_mode