Can I import database file directly from remote computer?

Avatar
  • Answered
In the article "How to import a database through shell", a mysql command was described that imported a local file into the local database: "mysql -p -u user_name data_base < new_databse.sql".

This worked well but it does require uploading a sometimes large .sql file to our dedicated server. Would this command work if I imported the database directly from our in-office computer by adding the -h (--host=our dedicated server) option to the mysql command?
Avatar
anonymous
Hello Marc, The remote SQL port is 3306 so if it is asking for one be sure to use it. Also your IP has to be added to the firewall for the connection to be accepted. Best Regards, TJ Edens
Avatar
Scott
Hello Marc,

Thank you for your question on remote importing a sql file. For shared accounts this would not be possible, however on VPS or Dedicated accounts you should be able to perform the remote import as opposed to having to upload the file to the server first.

Kindest Regards,
Scott M