Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Backup mysql database in xampp?

Hello everyone recently I made a database and our professor told us that we can make a copy of the database by copying the folder in xampp/mysql/data.

Then after i made my database I copied the folder of my database in there because I will continue making the database on another computer. It turns out that copying that folder along isnt enough, because it turns out that it can only read the database itself, but not the content of the tables in the database.

The content of the database folder "tablename".frm and a "db.opt".

Can someone teach me the proper way to backup a database? and what is the files that i need to copy in order to run the database I made on other Computer.

I have already read this but I can't seem to understand the instructions properly.(if ever this is the right way to backup it)

http://dev.mysql.com/doc/refman/5.0/en/innodb-backup.html

like image 207
Frankie Roy Sanqui Niverba Avatar asked Mar 08 '13 13:03

Frankie Roy Sanqui Niverba


2 Answers

There is Two way to backup your database
One:Folder backup In windows go to xampp installation folder xampp> mysql > data > here you find your database name folder. copy it and save it .
you can use any other computer just go to xampp installation folder xampp> mysql > data >paste it here.
Note: You should not overwrite the MySql default folders and only overwrite 3 files

  1. ibdata1
  2. ib_logfile0
  3. ib_logfile1

others should remain as default. Thanks otherewise you wont see your databases in PHPMyAdmin. Thanks
Two:export database .sql backup In browser go to phpmyadmin and select your database >then in to the top mane click Export. then write a name in New template input box .then click go .you will find a file is down loaded.
you can use it any other computer then go to phpmyadmin in browser and create a database and on the top menu click Import click choose file > select this file witch is downloaded > then click go button.

like image 71
MH Fuad Avatar answered Oct 31 '22 20:10

MH Fuad


At Your local screen for XAMPP (Inside your browser), go to PhpMyAdmin (on the left hand side) and Select MySQL, See your database on the top left, ensure it is selected. In the center screen there will be a menu tab, where there is an Import and next to it Export tabs. Select the Export tab. Here you will have to select all the tables you want to include in the backup, as well as set the name and set location for backup file (believe its the Download file by default). Remember to also ensure the type of backup file is selected. i.e. sql file etc.

After you have made this backup you can simply Import it again in XAMPP in your browser. should be relatively easy. Hope it helps.

like image 26
Lukas Avatar answered Oct 31 '22 22:10

Lukas