# Exporting contacts through commandline

**URL:** <https://forum.mautic.org/t/exporting-contacts-through-commandline/20199>\
**Category:** Product Support\
**Created:** [July 17, 2021, 3:42pm UTC](https://forum.mautic.org/t/exporting-contacts-through-commandline/20199 "2021-07-17T15:42:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wzard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/wzard/32/5490_2.png) [@wzard](https://forum.mautic.org/u/wzard)\
**Post date:** [July 17, 2021, 3:42pm UTC](https://forum.mautic.org/t/exporting-contacts-through-commandline/20199/1 "2021-07-17T15:42:26Z")

</div>

**Your software**  
My Mautic version is: 2.15  
My PHP version is: 7.125  
My Database type and version is: N/A

**Your problem**  
My problem is: I had an old mautic installation and some contacts on them. Now, the installation is not working ( some SSL issues ) and I cannot get into the application interface.

Is there any way to export the **contacts** data?

I have access to the command line.

Thanks in advance

---

<div class="post-metadata">

**Author:** ![mikew](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mikew/32/5156_2.png) [@mikew](https://forum.mautic.org/u/mikew)\
**Post date:** [July 18, 2021, 3:35pm UTC](https://forum.mautic.org/t/exporting-contacts-through-commandline/20199/2 "2021-07-18T15:35:57Z")

</div>

hey there,

sure if you are on a linux distribution run the following command:  
mysql -u your\_user db\_name -p -sN -e “select firstname, lastname, email from leads” \> all\_my\_leads.csv

where your\_user = the user to your database  
db\_name = your database name

Let me know if you need more help.

Regarding SSL there are ways to fix this as well. What distribution have you it installed on
