mysql数据库移动备份,移动和备份大型MySQL数据库

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.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值