移动和备份大型MySQL数据库 [英] Moving and Backing Up a Large MySQL Database

查看:145
本文介绍了移动和备份大型MySQL数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用MySQL Workbench,我建立了一个非常大(17 GB)的数据库。 MySQL将数据放在C:\ProgramData\MySQL\MySQL Server 5.5 \ data目录中名为ibdata1的单个文件中。我的C盘上的空间不足,我想把它移动到我的外部驱动器。是否可以移动ibdata1文件,然后告诉MySQL指向另一个位置来找到它?此外,如果我想备份该数据,我可以复制ibdata1文件并保存。

解决方案

是的,您可以更改



复制现有的数据目录(

默认位于C:/ Program Files / mysql / data)到新路径或目录。



使用以下命令编辑MySQL配置文件:



打开my.cnf或my.ini这个文件位于mysql bin目录。



查找datadir的条目,



重新启动MySQL伺服器。



/ p>

I'm using MySQL Workbench and I've built a very large (17 GB) database. MySQL puts the data in a single file called ibdata1 in the C:\ProgramData\MySQL\MySQL Server 5.5\data directory. I'm out of space on my C drive and I would like to move it to my external drive. Is it possible to move that ibdata1 file and then tell MySQL to point to another location to find it? Also, if I want to back up that data, can I just copy the ibdata1 file and save it. And then if my computer were stolen or something, could I somehow recover that data from that file?

解决方案

Yes you can change the data directory of your Mysql server.

Stop MySQL server from windows services.

Copy the existing data directory (default located in C:/Program Files/mysql/data) to New Path or Directory.

edit the MySQL configuration file with the following command:

Open the my.cnf or my.ini this file is located in mysql bin directory.

Look for the entry for datadir, and change the path to the new data directory.

Save and close the file.

Restart MySQL server.

这篇关于移动和备份大型MySQL数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆