Import XML file into a MySQL database?
I have a (LONG) rss feed xml file that I would like to import into a database. Any ideas? THANKS!!!
You can use software like phpmyadmin to enter the data, but it may crash or time out if there is a lot of data (more than 10mb of text, approximately).
Another option is to use PHP to read the file and enter it into the database, but that may hit the maximum execution time which is by default on most servers 30 seconds. You can change this setting, but it may still be slow.
The best method is to run this directly on the server using linux commands if you can.
All of this is assuming it is already in the MySQL backup format (as a query). If you need to convert it, I suggest just splitting it into many files and working with each individually-- mysql will automatically add them together when you insert them as rows.
Note that "10mb" above is approximate, but I've done this with 10-20mb files and it isn't usually a big problem (sometimes very slow, but usually works), so that should be ok. And that is a LOT of text. If you have a larger database, like 50mb (one of mine was this large) that will probably never work without running it as a file on the server or splitting it into several pieces. However, if your data is less than 10mb (most likely it is), I don't think it's going to be a big problem.
Daniel - Freelance Web Design | <?php?> | <html>| Deutsch | italiano | espa˝ol | portuguŕs | catalÓ | un peu de franšais | Ninasoma Kiswahili | 日本語の学生でした。| درست العربية