What will happen with MySQL transaction if one of the queries fails? I have 500 independent insert queries. I put them in a transaction to run faster. I am runing queries with PHP.

What will happen if one of queries fails? Will the transaction be rolled back automaticaly or not?

Maybe this question has been asked before, but I cannot find an answer. If there is one, please share it with me.
Deadlock or lock wait timeout == implicit transaction rollback.

All another errors will rollback only the statement, not whole transaction.

See InnoDB Error Handling in the documentation.