How can I copy the MySQL EXPLAIN result into a table?
If you are running on Linux OS you could save it into a file.

Example:

User='root'
Pass='text'
Host='10.0.0.223' (If it's remote)


On command line run:

mysql -u $User -p$Pass --host=$Host -e "EXPLAIN SELECT * FROM mysql.user LIMIT 0,2" | tee -a test.txt


mysql -e will execute the query on the command line.

tee -a will read from standard input and write to file test.txt

And you'll get:



You can use perl to replace the death lines to any delimiter you want (I used comma in this example).

perl -wnlpi -e 's/\s+/,/g;' text.txt


Example:



Hope this help.