Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
MySQL	Troubleshooting	
TL;DR
Ligaya	Turmelle	
Principal	Technical	Support	Engineer	-	MySQL	
ligaya.turmelle@oracle.com	
@lig	
rootconf	-	May	2017
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
MySQL	Troubleshooting	
TL;DR
Ligaya	Turmelle	
Principal	Technical	Support	Engineer	-	MySQL	
ligaya.turmelle@oracle.com	
@lig	
rootconf	-	May	2017
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Safe	Harbor	Statement
The	following	is	intended	to	outline	our	general	product	direction.	It	is	intended	for	
information	purposes	only,	and	may	not	be	incorporated	into	any	contract.	It	is	not	a	
commitment	to	deliver	any	material,	code,	or	functionality,	and	should	not	be	relied	upon	
in	making	purchasing	decisions.	The	development,	release,	and	timing	of	any	features	or	
functionality	described	for	Oracle’s	products	remains	at	the	sole	discretion	of	Oracle.
3
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Step	1
• Define	the	problem	
• Must	know	what	is	“normal”,	to	know	what	is	not	“normal”	-	and	how	
much	
• Be	exact!	
• Read	and	understand	the	manual	for	the	problematic	area
4
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Step	2
• Collect	the	diagnostic	data	
– OS	data	
– MySQL	data	
• May	need	to	collect	the	diagnostic	data	during	the	problem	
– Monitoring	
– Maybe	pt_stalk
5
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Error	Log
• First	place	to	look	
• Can	give	history	and	context	to	any	problem	
• Error	message(s)
6
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
General	Server	Crash
• Error	log	
– Stack	trace	and	error	message(s)	
• OS	error	log	around	the	crash	time	
– OOM	
• Any	and	all	diagnostic	data	available	
– MySQL	and	OS	monitoring	data	(graphs	and	raw	data)	
– Core	file?	
• Any	information	about	what	was	happening	before	and	during	the	crash	
– External	scripts	running	/	Applications	/	Cronjobs	/	Backups	/	Etc.
7
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
General	Performance	Issues
• Error	log	
• COS	data	(Ex:	IO,	CPU,	Memory,	NUMA,	etc.)	
• SHOW	GLOBAL	VARIABLES	
• SHOW	GLOBAL	STATUS	
• SHOW	FULL	PROCESSLIST	
• SHOW	ENGINE	INNODB	STATUS	
• Information	from	PERFORMANCE_SCHEMA
8
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Query	Performance	Issues
• Error	log	
• Slow	query	log	
• EXPLAIN	
• SHOW	CREATE	TABLE	
• SHOW	TABLE	STATUS	
• SHOW	INDEXES	
• Profile	the	query
9
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Table	Corruption
• InnoDB	
– System	may	or	may	not	be	able	to	start	back	up	
– Error	log	
• Error	message	
• Stack	trace	
– Known	issue?	
• Bug	
• Data	dictionary	issues	
– Rebuild	
• Go	to	a	backup	
• Force	recovery
10
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Table	Corruption
• MyISAM	
– Error	log	
– Marked	as	crashed?	
– myisamchk	or	mysqlcheck	
• Server	up	or	down?	
• Backup	corrupted	files	before	-	some	data	loss	can	happen	
– Backups	are	always	an	option
(con’t)
11
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
Replication	Issues
• Error	log	
• SHOW	MASTER	STATUS	
• my.cnf	/	my.ini	
• SHOW	GLOBAL	VARIABLES	
• SHOW	SLAVE	STATUS
12
Copyright	©	2017,	Oracle	and/or	its	affiliates.	All	rights	reserved.		|
MySQL	Troubleshooting	
TL;DR
Ligaya	Turmelle	
Principal	Technical	Support	Engineer	-	MySQL	
ligaya.turmelle@oracle.com	
@lig	
rootconf	-	May	2017
Troubleshooting tldr

Troubleshooting tldr