Categories

Archive

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 ›