定期制作Live MySQL数据库副本 [英] Make a Copy of Live MySQL database periodically

查看:106
本文介绍了定期制作Live MySQL数据库副本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了问题.我正在做一个后台项目,该项目需要访问我们网站的实时数据库,该数据库很大而且很复杂.现在,当我将后台办公室与实时Mysql数据库连接并运行查询时,还会出现一些缓慢的查询,这些查询又会在该时间段内锁定数据库,从而使实时网站变慢.

I am stuck with a problem. I am working on a backoffice project which needs to access the live database of our website which is very big and complicated. Now when i connect my backoffice with live Mysql database and run my queries, some slow queries are also there which in turn locks the database for that time period and the live website becomes slow.

有人建议我定期复制实时数据库,并将复制的数据库与我的后台应用程序一起使用.但是我也已经看到,在一台服务器上,如果您在PHP Myadmin上有2个数据库,并且在一个数据库上已经运行了一个缓慢的查询,则该服务器上的CPU使用率非常高,我认为即使我使用复制的数据库对于后台,它仍然会阻止查询,并使后台或实时网站运行缓慢.

Somebody suggested me to make a copy of the live database periodically and use the copied database with my backoffice app. But i have also seen that on one server, if you have 2 databases on PHP Myadmin, and there is a slow query already running on one database, the CPU usage is pretty high on the server and i think even if i use the copied database for backoffice, it will still block the queries and make either backoffice or live website slow.

关于如何实现一个不影响应用程序一致性和速度的好的解决方案的任何想法.任何出色的分步过程将不胜感激.

Any ideas on how i can implement a good solution which does not affect consistency and speed of the applications. Any nice step by step procedure will be greatly appreciated.

谢谢

推荐答案

您可能想看一下mysql复制,此处介绍了更多内容

you might want to look at mysql replication, a litte more is described here

http://dev.mysql.com/doc/refman/5.0/en/replication.html

基本上,您将实时(主)数据库复制到另一个可用于开发的框中.

basically you replicate your live (master) database to another box that you can use to develop.

这篇关于定期制作Live MySQL数据库副本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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