large result set of mysql select query
What would开发者_如何学编程 be the easiest way to split an sql file of 80mb into multiple smaller sql files? thanks. dani.
You can use the LIMIT
and OFFSET
statements to select a certain number of rows.
For example:
SELECT column FROM table
LIMIT 10
gets you the first 10 results of your query.
SELECT column FROM table
LIMIT 10 OFFSET 10
gets you 11-20 from your results set.
You can find some utilities out there to do the job, here is the first one I found on google http://www.rusiczki.net/2007/01/24/sql-dump-file-splitter/ .
If you have trouble importing the file I suggest you import it using mysql client console.
精彩评论