Search the Site:

Instructions to import a MySQL database using SSH

Instructions to import a MySQL database using SSH

  1. Log into your Web space using an FTP/ SFTP client. You will need to know your username and password.
  2. Find your existing .SQL database and upload it to your Web space using your FTP/ SFTP client. Make sure you remember the path to where you upload this file.
  3. You may also use SCP client instead of an FTP/ SFTP client to upload the file, if your web host supports it.
  4. Log into your Web space using a SSH client you are comfortable using. You will need the username and password assigned to you by your Web-hosting provider.
  5. Your web hosting provider might give you access via Telnet instead of SSH. That should be fine as well. Login using a Telnet client in this scenario.
  6. Enter the following into the command line, using your own database name, file name, username and password instead of the words in capitals.

    mysql -uUSERNAME –pPASSWORD DATABASENAME < /PATH/TO/DATABASEBACKUPFILE.sql

    For example, if my username was "nibbleguru", my password "example", my database name "testdb" and the absolute path to my file "/home/nibbleguru/my_db_backup.sql", I would type:

    mysql –unibbleguru –pexample testdb < /home/nibbleguru/my_db_backup.sql

Reply

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <i> <object> <param> <embed> <blockquote>
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

2 Steps to Post a New Problem

2 Steps to Post a New Problem

Register
Login
Post New Problem

DISCLAIMER: The content on the site has been submitted by the users. NibbleGuru.com has no responsibility other than in removing material from the website when we have been notified of a copyright violation. Notify here.