public function import($sqlFile, $charsetMode = null)
    {
        if (!file_exists($sqlFile)) {
            throw new Exception("File '$sqlFile' was not found.");
        }

        $credentialsFile = $this->databaseDefaultsFileGenerator->generate();
        $charsetMode = $charsetMode ? $charsetMode : $this->getCharsetMode();
        $command = 'mysql --defaults-file=' . $credentialsFile;
        $command .= ' --default-character-set=' . $charsetMode;
        $command .= ' ' .escapeshellarg($this->getDbName());
        $command .= ' < ' . escapeshellarg($sqlFile);
        $this->executeCommand($command);
        unlink($credentialsFile);
    }