How to upload sql files from shell/bash

Importing the SQL file another way

If you have a Unix/Linux server and have SSH access to it then you can use the `mysql’ command line program to import the file like so:

mysql -u myuser -p mydatabase < myfile.sql

This will prompt you for the password for `myuser’ and then import the SQL from myfile.sql. Obviously you will need to have uploaded myfile.sql through FTP or similar. Ideally you would compress myfile.sql, upload it, uncompress it and then import using the command above.

via Overcoming file size limits when uploading SQL files to phpMyAdmin – Interspire Knowledge Base.

Leave a Reply

Close Menu
%d bloggers like this: