Better sollution for mysql connect