The second example is correct. It doesn't matter to me, it isn't important to me. Those are both correct
IMPORTANT
of much or great significance or consequence:
<em style="color: rgb(74, 74, 74);">an important event in world history</em>
mattering much (usually followed by <em style="color: rgb(26, 26, 26);">to</em>):
<em style="color: rgb(74, 74, 74);">details important to a fair decision.</em>
entitled to more than ordinary consideration or notice:
<em style="color: rgb(74, 74, 74);">an important exception.</em>
prominent or large:
<em style="color: rgb(74, 74, 74);">He played an important part in national politics.</em>
of considerable influence or authority, as a person or position:
<em style="color: rgb(74, 74, 74);">an important scientist.</em>
having social position or distinction, as a person or family:
<em style="color: rgb(74, 74, 74);">important guests.</em>
<em style="color: rgb(74, 74, 74);">MATTERS</em>
<em style="color: rgb(26, 26, 26);">verb (used without object)</em>
<em style="color: rgb(74, 74, 74);">It matters little.</em>