Commcare-export To MySQL

Hi Support Team,
I’m trying to export data from CommCare Export tool to my local MySQL Database and connect it to Tableau ou Power BI.
Please could give some support on that ? I’ve already installed all dependencies

Hi Aboubacar,

Thanks for your question, and for your interest in the CommCare Export Tool!

I would first recommend consulting the following link for good documentation on CommCare Export Tool, specifically related to SQL exports.

That said, I know that the syntax can be confusing, given the variety of databases we support. Here’s an example of a command that will launch the commcare-export into a local MySQL database:

commcare-export --output-format sql --output mysql+pymysql://$MYSQL_USER:’$MYSQL_PASSWORD’@$MYSQL_DB_NAME?charset=utf8 --project my-project-space --query my_query_file.xlsx --username $COMMCARE_USERNAME --password $COMMCARE_PASSWORD --verbose

Here, $MYSQL_USER, $MYSQL_PASSWORD, $MYSQL_DB_NAME, my-project-space, my_query_file.xlsx, $COMMCARE_USERNAME, and $COMMCARE_PASSWORD are all variables to be filled in (and the --verbose flag is optional).

Can you run the command above and let us know if you run into any problems?


Thanks @Jessica this is very useful, in fact I have little bit misundertanding about my_query_file.xlsx file, supposed i have case managment app ( registration and follow-up forms) how to integrate those forms into database, registration and follow-up forms as tables, what’s the role of my_query_file.xlsx file?