开发者

How can I move MySQL data directory on Mac OS 10.5? (and related questions)

I've managed to mess up my MySQL database (on Mac OS X 10.5) and need help recovering!

I tried to add an index to a fairly large table (190 million records) and in the course of this, I ran out of disk space. Subsequently realized that the partition with the data directory is too small and so I need to开发者_JAVA百科 move it.

Initially I thought that I would just copy the data directory to another location, then bung a symlink in place of the original data directory.

BUT it refuses to move!

sudo cp -r /usr/local/mysql/data .
cp: ./data: Permission denied

(I have stopped the mysqld process before attempting this move)

Help!


This isn't a mysql question, but rather an OS question.

I would guess that you either don't have permission to write to the current directory, or there's already a directory there named 'data' that you don't have permission on, etc.

In my experience, MySQL doesn't like running out of disk space at all. Make sure the last records are OK after you bring the engine back up.

Also, don't use the symlink - change the mysql config. In Unix, this would be the 'datadir' setting in /etc/my.cnf.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜