Added MySQL/MariaDB support. Some changes for embedded connections