Add config option to run arbitrary SQL commands after connecting to a MySQLi database, closes #831 and refs #646 (also see 6172b6d03c9e7cd883228b45ada3ba2a6a9d5234)