Update query to Reset counter when date column changes
Do it like this:

select column1,column_sec,attempt,date,
@num := if(@v1 != date OR @v2 != column_sec OR @v3 != column1, 1, @num + 1) AS counter,
@v1 := date,
@v2 := column_sec,
@v3 := column1
from table_name 
cross join (select @v1 := '', @v2 :='',@v3 :='', @num := 0) var_init_subquery
where date is not null
order by column1,column_sec,attempt;


The key is, that you have to check first, then assign the value of the current row. In the query you tried, you never assigned anything to the variables. When the next row (and the therefore the select clause) is processed, the variables hold the value of the previous row in the check, then the value of the current row is assigned to the variables.