Add "strict" setting for MySQL connection

Replaces #3138.