---
title: Import an SQL File from the Command Line
description: "Use a command-line import when a database backup is too large for a browser-based upload or when you need a repeatable deployment workflow. The process transfers an SQL file directly into an existing MySQL or MariaDB database. ## Before you…"
url: "https://support.jansma.vip/docs/vip-hosting/databases/import-an-sql-file-from-the-command-line/"
updated: "2026-09-27"
category: Databases
---

# Import an SQL File from the Command Line

Use a command-line import when a database backup is too large for a browser-based upload or when you need a repeatable deployment workflow. The process transfers an SQL file directly into an existing MySQL or MariaDB database.

## Before you begin

- Create the destination database and database user in your Jansma VIP Hosting control panel.
- Confirm the database name, username, password and hostname.
- Upload the SQL file to a private directory in your hosting space.
- Take a current backup before replacing live data.

## Import the SQL file

Connect to the hosting account through SSH, change to the directory that contains the backup and run the MySQL client with your database credentials. A typical command is `mysql -h DATABASE_HOST -u DATABASE_USER -p DATABASE_NAME < backup.sql`. Enter the database password only when prompted; do not place it directly in the command or save it in a public file.

## Verify the result

A successful command usually returns to the prompt without an error. Open phpMyAdmin or your application and confirm that the expected tables and recent records exist. If the import stops, review the first reported SQL error, confirm that the backup is complete and check whether the database user has sufficient permissions.

Large imports can take several minutes. Keep the SSH session open until the command finishes. Contact Jansma VIP Support if an import repeatedly fails after the credentials, file encoding and available database space have been checked.
