I am working on a test site locally. I am loading an xml file into my database with teh following sql query:

LOAD XML LOCAL INFILE 'C:/courseInfo18.xml' 
INTO TABLE wp_courses ROWS IDENTIFIED BY '<Course>' (ReferenceNo, ProviderCode, ProviderName, CourseID, CourseName, 
    CourseTypeID, CourseTypeName, LocationCode, LocationName, StartDate, 
    FinishDate) ;

It works fine locally but not on the live site. I have checked the MySQL version of the live site and it is running only 5.0.8 could this be the reason or does anyone know if there is an alterative way to do this on an older version of MySQL.

Thanks in advance,

Donna :)

This probably won't help and will only annoy you but always develop with the versions you are deploying to!

Hi Dave,

I am relatively new to MySQL, so lesson learnt!


you need at least MySQL 5.1.5 to import XML, otherwise you have to check if a UDF (user defined function) was developed to support old versions. In the documentation you can find a comment (bottom of the page) that suggests a workaround, sincerly I wouldn't use it. If possible instead try to upgrade the database:

Well you took that well, better than anticipated :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.