5
Contributors
5
Replies
37
Views
4 Years
Discussion Span
Last Post by bantex07
0

If you're using XAMPP, its easiest to "export" all databases from phpMyAdmin, and then "import" them on your new machine.

1

You use mysqldump program to export database into a SQL file, something like:

mysqldump -u USER -p DATABASE > FILENAME.sql

then use mysql client to import SQL file into another database:

mysql -u USER -p DATABASE < FILENAME.sql

This was taken from this link.

EDIT: I just noticed that you said you use Xamp. I think these two programs should be available in xamp but I am not 100% sure.

Edited by broj1

0

Import from mysql command line
Two ways to import datase in mysql from .sql file

    • Open MySQL command line client or execute mysql.exe from command prompt present in MySQL installation path.
      Create a new database .
      mysql> Create database test
      mysql> use test
    • Then import the database into test databse by using one of this commend:-
      source test.sql
      or
      ./ test.sql
  1. Go to the location where mysql is installed or add MySQL.exe location(insth/bin) in system environment path:-
    MySQL->bin
    now execute following command:-
    mysql -u <user> -p<password> -h <hostname> <database> < /path/to/updated_script/database.sql

Export database

mysqldump -u <user> -p<password> -h database --result-file="location_to_export_database.sql"

Edited by IIM

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.