The file is a compressed (compressed) SQL file, almost certainly a simple text file with the extension .sql. The first thing you need to do is copy the file to the database server using scp .. I think PuTTY is pscp.exe
Then ssh to your server and unzip the file using gunzip
user@serverhostname$ gunzip numbers.sql.gz user@serverhostname$ ls numbers.sql
Finally, import it into your MySQL database using the input redirection operator < :
user@serverhostname$ mysql -u mysqluser -p < numbers.sql
If the numbers.sql file does not create the database, but expects that it is already present, you will also need to add the database to the command:
user@serverhostname$ mysql -u mysqluser -p databasename < numbers.sql
If you have the ability to connect directly to the MySQL server from the outside, you can use the local MySQL client instead of copying and SSH. In this case, you just need a utility that can unzip .gz files on Windows. I believe 7zip does this, or you can get gzip / gunzip binaries for Windows.
Michael Berkowski Jun 10 2018-12-12T00: 00Z
source share