开发者

SQL dumping is locking the database and crashing my website [duplicate]

This question a开发者_JAVA百科lready has answers here: Closed 12 years ago.

Possible Duplicate:

Run MySQLDump without Locking Tables

My website uses a mysql 5 database with a MyISAM engine.

I would like to use mysqldump to back up the database or create copies of it, but whenever I use it, it locks the database, thus crashing my website..

Any ideas on how to back up my database without causing downtime?


If your database relies on any kind of referential integrity, it'll be essential to lock at least parts of it whilst performing a dump. (Otherwise, you'll get snapshots of the various tables at different times, which is likely to cause issues.)

That said, unless you have a very, very large database this shouldn't be a significant issue. (i.e.: It really shouldn't take that long.) How much data is in the database?

Update:

You can use the --lock-tables=false mysqldump option, but you need to be aware of the consequences of this as outlined above.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜