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.