How to import sql database using Terminal?


Uploading the database to your XAMPP phpmyadmin is faster using Terminal than doing it from phpmyadmin. For this please follow the following steps.

  1. Open the Terminal and cd into the folder where the sql database you need to upload is located.
  2. Login to your mysql using the commond
    mysql -u”Your Username” -p”Your Password”
  3. If the terminal asks for the password, enter the password you entered for localhost.
  4. Create a new database by the following command.
    Create “Your Database Name”. If you have already created the database, then select database using “USE <DatabaseName>”
  5. Give the import command by typing the following:
    source “SQL File name”;

    Your sql should be imported really fast and successfully.

3 thoughts on “How to import sql database using Terminal?”

  1. But wanna input on few general things, The website style is perfect, the subject matter is very superb. “To establish oneself in the world, one has to do all one can to appear established.” by Francois de La Rochefoucauld.

Leave a Comment

Your email address will not be published. Required fields are marked *