dbcloud

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_%\';

分类:

技术点:

相关文章:

  • 2021-11-23
  • 2021-10-24
  • 2021-08-28
  • 2021-12-14
  • 2021-11-27
  • 2021-11-14
  • 2022-01-02
猜你喜欢
  • 2021-10-08
  • 2021-10-19
  • 2021-11-02
  • 2021-09-07
  • 2021-11-18
  • 2021-11-04
相关资源
相似解决方案