"To remedy the problem, first check whether your query is correct. Is it reasonable that it should return so many rows? If not, correct the query and try again. Otherwise, you can invoke mysql with the --quick option. This causes it to use the mysql_use_result() C API function to retrieve the result set, which places less of a load on the client (but more on the server). "

To easily manage MySQL over the web, try to use PHPMyAdmin. It is very useful. With this you will also be able to easily export or backup your database(s) without having to write the queries manually.

You may not get this error in the 'Production' environment even though you have the same set up. If your internal server has more memory / free space than your testing server then you may not get this error.

I am also curious. What engine are you using? For larger databases you should be using InnoDB. Usually by default MyISAM is used. You can easily change the tables from MyISAM to InnoDB without affecting the records or anything. Please post back if you figured it out and if any of this helped. I hope it does. =)