Mysql 导出Apple HealthKit数据
我导出健康应用程序dataApple并希望导入到我的数据库中进行进一步开发。但是,当我运行以下命令时:Mysql 导出Apple HealthKit数据,mysql,healthkit,Mysql,Healthkit,我导出健康应用程序dataApple并希望导入到我的数据库中进行进一步开发。但是,当我运行以下命令时: load xml local infile 'PATHTOFILE' into Table Record rows identified by '<Record>' 什么也没发生。我试图修改从apple health app导出的文件中的两个标签 <ExportDate value="20150424105126+0800"/> <Me HKCharacter
load xml local infile 'PATHTOFILE'
into Table Record
rows identified by '<Record>'
什么也没发生。我试图修改从apple health app导出的文件中的两个标签
<ExportDate value="20150424105126+0800"/>
<Me HKCharacteristicTypeIdentifierDateOfBirth="" HKCharacteristicTypeIdentifierBiologicalSex="0" HKCharacteristicTypeIdentifierBloodType="0"/>
您是否通过其中一个在线格式检查程序运行过XML?XML文件很好,我发现问题可能发生在使用“row identified by*”时,它可能不适合我的XML文件。无论如何,谢谢~是的,我从未像那样将XML加载到MySQL中。只是CSV。无论如何,祝你好运!你能描述一下表格记录吗?可能是唯一密钥的问题。HealthData示例具有唯一的UUID,我将导出/导入UUID,以确保所有记录只导入一次。
<ExportDate value="20150424105126+0800"/>
<Me HKCharacteristicTypeIdentifierDateOfBirth="" HKCharacteristicTypeIdentifierBiologicalSex="0" HKCharacteristicTypeIdentifierBloodType="0"/>
<?xml version="1.0" encoding="UTF-8"?>
<HealthData locale="en_CA">
<ExportDate value="20150424105126+0800"/>
<Me HKCharacteristicTypeIdentifierDateOfBirth="" HKCharacteristicTypeIdentifierBiologicalSex="0" HKCharacteristicTypeIdentifierBloodType="0"/>
<Record type="HKQuantityTypeIdentifierStepCount" source="Mi Fit" unit="count" startDate="20150423120000+0800" endDate="20150423120100+0800" value="11.5365" recordCount="1"/>
<Record type="HKQuantityTypeIdentifierStepCount" source="Mi Fit" unit="count" startDate="20150423120100+0800" endDate="20150423120200+0800" value="11.5365" recordCount="1"/>
<Record type="HKQuantityTypeIdentifierStepCount" source="Mi Fit" unit="count" startDate="20150423120200+0800" endDate="20150423120300+0800" value="11.5365" recordCount="1"/>