$A$: commutative ring with unit.
(1) $I$ is a primary ideal of $A$.
(2) If $a,b \in A$, and $ab \in I$, then there exists a positive integer $n$ such that
$a^n \in I$ or $b^n \in I$.
I notice that they are equivalent when $I$ is prime. So I am looking for a primary ideal which is not prime as a counterexample.
No these are not equivalent. Consider:
$\ \ \ \ $ $(2)'$ $\sqrt{I}$ is prime
and check that $(2)'$ is equivalent to $(2)$.
So for a counterexample, we want a ring $R$ with an ideal $I$ such that $\sqrt{I}$ is prime but $I$ is not primary.
This has been asked about and answered many times on stackexchange, but it is a good exercise to find a counterexample for yourself.