I'm trying to find a way to efficiently compare a CSV file content with a MySQL database (Over 1 Million rows to compare), I've done something similiar before just placing all the rows into an array but that will work for a small number of rows because of memory overloading.

My question is, is there a recommendable way to doing that? Any libraries or something that could help?

I would appretiate your answers.