Categories

Archive

MySQL Log

SHOW VARIABLES like ‚%log%‘; SELECT @@log_warnings; SET GLOBAL log_warnings=2; log_warnings = 2 log_error_verbosity = 3 SET GLOBAL log_error_verbosity=2; — set it SELECT @@log_error_verbosity=2; log_error_verbosity 1 ERROR 2 ERROR, WARNING 3 ERROR, WARNING, INFORMATION

mysql user export -> transfer

mysql – u root — password = PW – e „select concat(’show grants for ‚,’\“,user,’\’@\“,host,’\“) from mysql.user“ > user_list_with_header.txt sed ‚1d‘ user_list_with_header.txt >./ user .txt WHILE READ user; DO mysql – u root — password = PW – e „$user“ Read more ›

mysql tablesize

SELECT table_schema as `Database`, table_name AS `Table`, round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB` FROM information_schema.TABLES ORDER BY (data_length + index_length) DESC;

mysql cache check

SHOW GLOBAL VARIABLES LIKE „long_query_time“; SHOW VARIABLES LIKE ‚%query_cache%‘; SHOW VARIABLES LIKE ‚%query%‘; SET GLOBAL general_log = 0; SHOW VARIABLES LIKE ‚%general_log%‘; SET GLOBAL slow_query_log = 1; SET GLOBAL query_cache_size = 0; SET @@GLOBAL.long_query_time = 1; SHOW STATUS LIKE ‚Qcache%‘; Read more ›