Lost connection to MySQL server during query
8 million rows? - network speed will determine how long it takes to download the rows, but as to why you are losing connection, you'd have to dig deeper to see if you have a timeout setting?