Fóruns
The great place to discuss topics with other users
How to Import a SQL File into MySQL via SSH (No phpMyAdmin required)
'
Join the Conversation
Resposta ao Post
2025-06-01 20:49:41
Step 1: Upload the SQL file via SFTP or SCP
Put youdatabase.sql in your home dir or /tmp/:
scp youdatabase.sql root@your-server-ip:/tmp/
Or use FileZilla to upload it into /root or /tmp.
Step 2. Run the Import
mysql -u yourdatabaseUsername -p yourdatabaseName < /tmp/youdatabase.sql
It will ask for the password:
yourdatabasePassword
🚨 Make sure that user has full privileges on yourdatabaseName. If not, use root:
mysql -u root -p < /tmp/yourdatabaseName.sql
That is all :)