Reputation: 455
I am using XAMPP package in my own desktop with Window 7 as OS.
That means I'm using MySQL DB and Apache server.
Now I would like to copy/migrate my whole MySQL DB to my friend's desktop, which is also with Window as OS, and also using XAMPP package.
Is there any way for me to do that?
Upvotes: 23
Views: 82342
Reputation: 2223
Given solutions didn't work for me. These are the steps solved my problem -
xampp/mysql/data/ibdata1
from old installation to new installationmysql
, performance_schema
, phpmyadmin
from xampp/mysql/data
and put them in new installationHope it helps.
Upvotes: 1
Reputation: 3884
The datadir defaults to something like C:\Program Files\MySQL\MySQL Server 5.0\data
You can just zip that folder and unzip it in the new server (with mysql server shut down in both servers) in the same place, and start mysql server there. This assumes that your datadir setting is the same in both servers.
Upvotes: 0
Reputation: 6185
A.Aleem11's answer will technically work but is a little too cautious and copies files over that don't contain any data or config information and are only relevant for the previous installation.
The answer is actually a lot simpler:
Make sure Apache and MySQL are turned off
In your new XAMPP installation, delete the mysql\data
and mysql\backup
folders
Copy the mysql\data
and mysql\backup
folders in your old XAMPP installation to the new installation
(Optional) If you have any config files in your old mysql
folder (files that end in the .cfg
extension and have the gear icon), copy these too. Chances are that if your MySQL installation is relatively recent you will have none of these, config files seem to be relied on less in modern versions.
Turn Apache and MySQL back on and navigate to localhost/PHPMyAdmin
to confirm that all your database tables are present
Upvotes: 2
Reputation: 1974
Copy database files from MySQL folder (under old xampp folder) except share,bin, and script folder see attached image to see which files need copy (only files with in green box) and replace all these database files in new installed xampp directory in MySQL folder.
Restart xampp start MySQL and open database and table to make sure its working.
Upvotes: 60
Reputation: 739
Yes.
You can use the command line tool mysqldump
Saving your database
mysqldump -u[yourusername] -p[yourpassword] --all-databases > mydump.sql
Reading it back in:
mysql -u[yourusername] -p[yourpassword] < mydump.sql
I'm assuming the mysql bin directory is accessible via command line. [yourusername] and [yourpassword] should be written without the brackets.
Upvotes: 10
Reputation: 4437
go to this address http://127.0.0.1/ and next phpmyadmin select database and click in export and select column ... and click on go
copy file to server and goto phpmyadmin in server and click on import and add file database and enjoy it .
Upvotes: 4