1. 程式人生 > >xshell 常用快捷鍵

xshell 常用快捷鍵

read_only _id var xshell 只讀 limit time nod 執行時間

1、連接mysql數據庫
mysql -uroot -p -h127.0.0.1 -P3306

2、列出所有session
show full processlist;

3、查看20條執行時間最長的SQL
select * from information_schema.PROCESSLIST ORDER BY TIME desc limit 20;

4、查看slave同步狀態
show slave status\G

5、查看master binlog或者gtid當前位置
show master status\G

6、查看數據庫是否為只讀模式
show variables where Variable_name like ‘read_only‘ or Variable_name like ‘%uuid%‘ or Variable_name like ‘server_id‘;

7、列出所有用戶
select user,host,concat(‘show grants for ‘,user,‘@\‘‘,host,‘\‘;‘) showSql from mysql.user;

8、查看事物提交基本及binlog寫入時間
show variables where Variable_name like ‘innodb_flush_log_at_trx_commit‘ or Variable_name like ‘sync_%‘;

xshell 常用快捷鍵