There are two ways in which database can be imported in XAMMP, it can be done directly through phpmyadmin interface or by using shell commands. If the database is of small size then you can go ahead and import using phpadmin, if the database is very large then it should be imported using command line.

Import using phpmyadmin

  1. Go to http://localhost/phpmyadmin from browser
  2. Create new database if it does not exist, if database already exists then click on the database where you want to import
  3. Click on the import tab
  4. In "File to import:" section choose the sql or zipped file which needs to be uploaded
  5. Click on "Go" button at the bottom of page
    Your database will be imported in few minutes and shall be ready.

Import using command line

  1. Open XAMMP Window
  2. Click on shell which will open the shell window
  3. Open mysql in shell using the following command
     mysql -u {username} -p {password}  
  4. Enter the following command to select desired database
     USE {databasename} 
  5. Database can be imported using the following command
 source ./{filename.sql} 

Please note that the file should not be in zipped format while importing using command line