1.查询mysql的pid
命令:ps -ef|grep mysqld
2.通过top -p mysqlpid -H 查看mysql各进程cpu占用情况
top -p mysqlpid -H
3.找到cpu占用异常的进程的thread_os_id
4. 查询进程id
select thread_id,name ,PROCESSLIST_ID,THREAD_OS_ID from performance_schema.threads where thread_os_id = ‘21001’
5.查询出具体的问题sql
select DIGEST_TEXT from performance_schema.events_statements_current where thread_id = 32482