Tuesday, April 19, 2022
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
Trace the SQL Queries in MYSQL
Trace the SQL Queries in MYSQL
For trace, the Queries executing from the application side in MariaDB provides a general_log parameter for enabling and disabling the traces.
Check status of General Log
mysql> select @@general_log;
For Enable the trace of SQL Queries:
mysql> set global general_log=1;
mysql> select @@general_log;
For Disable the trace of SQL Queries:
set global general_log=0;
Check and change the general log output as FILE or TABLE
-- Check the log file output format:
mysql> select @@log_output;
Check the file location:
mysql> select @@general_log_file;
--Change the log file format to TABLE:
SET GLOBAL log_output='TABLE';
Check the table for Log generation or SQL traces:
select * from mysql.general_log;
--Empty the table if no need
truncate table mysql.general_log;