MySQL 在xampp中备份mysql数据库?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/15294830/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 16:48:50  来源:igfitidea点击:

Backup mysql database in xampp?

mysqlphpmyadminxampp

提问by Frankie Roy Sanqui Niverba

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.

大家好,最近我做了一个数据库,我们的教授告诉我们,我们可以通过复制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".

数据库文件夹“tablename”.frm 和“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

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

回答by MH Fuad

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

有两种备份数据库的方法
一:文件夹备份在 Windows 中转到 xampp 安装文件夹 xampp> mysql > 数据 > 在这里您可以找到您的数据库名称文件夹。复制并保存。
您可以使用任何其他计算机,只需转到 xampp 安装文件夹 xampp> mysql > 数据 > 将其粘贴到此处即可。
注意:你不应该覆盖MySql默认文件夹,只覆盖3个文件

  1. ibdata1
  2. ib_logfile0
  3. ib_logfile1
  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 gobutton.

其他应保持默认。谢谢,否则你不会在 PHPMyAdmin 中看到你的数据库。谢谢
二:导出数据库 .sql 备份在浏览器中转到 phpmyadmin 并选择您的数据库 > 然后在顶部鬃毛中单击导出。然后在新模板输入框中写一个名字。然后点击go。你会发现一个文件被下载了。
您可以在任何其他计算机上使用它,然后在浏览器中转到 phpmyadmin 并创建一个数据库,然后在顶部菜单上单击“导入”单击“选择文件”>“选择此文件已下载”> 然后单击“转到”按钮。

回答by Lukas

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.

在 XAMPP 的本地屏幕(在浏览器中),转到 PhpMyAdmin(在左侧)并选择 MySQL,在左上角查看您的数据库,确保它被选中。在中心屏幕中会有一个菜单选项卡,其中有一个导入和导出选项卡。选择导出选项卡。在这里,您必须选择要包含在备份中的所有表,并设置备份文件的名称和设置位置(默认情况下是下载文件)。请记住还要确保选择了备份文件的类型。即sql文件等。

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

完成此备份后,您只需在浏览器的 XAMPP 中再次导入即可。应该比较容易。希望能帮助到你。