Arama Yap Mesaj Gönder
Biz Sizi Arayalım
+90
X
X
X
X

Knowledge Base

Homepage Knowledge Base General Uploading Large SQL Files: A Seamle...

Bize Ulaşın

Konum Halkalı merkez mahallesi fatih cd ozgur apt no 46 , Küçükçekmece , İstanbul , 34303 , TR

Uploading Large SQL Files: A Seamless Solution with SSH

Uploading large SQL files via cPanel or phpMyAdmin often fails due to timeouts or file size limits. In such cases, the most effective solution is to directly transfer the SQL file to the server via SSH using the mysql command.

Here's an example command:

mysql -u ekasunucu_db -p'dbsifre' ekasunucu_db < /home/ekasunucu/public_html/ekasunucu_db.sql

Details about this command:

  • -u ekasunucu_db: This is the database username.

  • -p'dbsifre': The database password is written within ' '. Quotes are mandatory if the password contains spaces.

  • ekasunucu_db: This is the name of the database where the backup will be loaded.

  • < /home/ekasunucu/public_html/ekasunucu_db.sql: The full path to the backup file on the server must be provided.

Step-by-Step Guide to Uploading SQL Files via SSH

  1. Connect to the Server via SSH

ssh root@sunucu_ip
  1. Check the File Location

ls -lah /home/ekasunucu/public_html/

Make sure the SQL file is actually in this directory.

  1. Prepare Database Information

  • Database name

  • Username

  • Password

  1. Upload the Backup File

mysql -u username -p'password' databasename < /file/path/backup.sql

Example:

mysql -u ekasunucu_db -p'PasswordHere' ekasunucu_db < /home/ekasunucu/public_html/ekasunucu_db.sql
  1. Check for Errors After the Process is Complete

  • If no error is written to the command line, the upload is successful.

  • Alternatively, you can check the number of tables in the database:

mysql -u ekasunucu_db -p
use ekasunucu_db;
show tables;

Things to Consider

  • If the SQL file is very large, use screen or tmux to prevent the session from disconnecting.

  • It is better for security to enter the password interactively after writing -p instead of giving the password directly in the command:

mysql -u ekasunucu_db -p ekasunucu_db < /home/ekasunucu/public_html/ekasunucu_db.sql
  • Before transferring the file, the encoding and CHARSET compatibility of the file content should be checked.

This method is one of the safest and fastest solutions, especially for high-dimensional database migration operations. It can be easily applied on all servers with SSH access.

 

Can't find the information you are looking for?

Create a Support Ticket
Did you find it useful?
(285 times viewed / 216 people found it helpful)

Call now to get more detailed information about our products and services.

Top