Tuesday, April 19, 2022
Check the Version of MariaDB / MySQL
Check used & available maximum connection in MySQL
Check used & available maximum connection in MySQL
Check maximum available connection in MySQL
mysql> show global variables like 'max_connections';
Check used connection in MySQL
mysql> show global status like 'max_used_connections';
Check connected session list or Process list in MySQL
select id,user,host,db,command,time,state,info from information_schema.processlist;
Create structure, duplicate & back up the table in MySQL
Create structure, duplicate & back up the table in MySQL
Use of CTAS for creating the Duplicate table with data or only structure (by using where 1 = 0) in the following database as follows:
MySQL: Use CTAS Syntax:
-- Create structure only
create table test_table_new like test_table;
-- Insert data into backup table
insert test_table_new select * from test_table;
Query OK, 2 rows affected (0.00 sec)
Records: 2 Duplicates: 0 Warnings: 0
Kill idle connection in MySQL
Kill idle connection in MySQL
Find the dependence on Table in MYSQL / MariaDB
Find the dependence on Table in MYSQL / MariaDB
Start and Stop and restart the MariaDB or MySQL on Linux
Start and Stop and restart the MariaDB or MySQL on Linux
Check status for the MariaDB or MySQL
ps -ef|grep mysql
Check status for the MariaDB or MySQL
service mysqld status
Service mysql status
/etc/init.d/mysql status
/etc/init.d/mysqld status
Start the MariaDB or MySQL in Linux Environment:
service mysqld start
service mysql start
/etc/init.d/mysql start
/etc/init.d/mysqld start
Stop the MariaDB or MySQL in Linux Environment
service mysqld stop
service mysql stop
/etc/init.d/mysql stop
/etc/init.d/mysqld stop
Restart the MariaDB or MySQL Services in Linux Environment
service mysqld restart
service mysql restar
/etc/init.d/mysql restart
/etc/init.d/mysqld restart