Wordpress Hack #8: How to Optimize and Backup Your Wordpress Database WordPress的哈克# 8 :如何優化和備份您的WordPress的數據庫
(3 pages) 2,279 views - ( 3頁) 2279意見者:管Posted in: 張貼於:
2,279 views 2279意見
Please note: This page was originally written in English.請注意:此網頁最初是用英文寫的。
The original post can be viewed原來的文章可被視為 here這裡 . 。
Please note: This page was originally written in English.
The text has been translated using an online service such as Google or Babelfish.
The original post can be viewed here.
Do you know how to optimize and backup your Wordpress database? 你知道如何優化和備份您的WordPress的數據庫? Most people don’t - until it’s too late! 大多數人並不-直到為時已晚! I’ll show you how to protect yourself and keep your blog running smooth! 我會告訴你如何保護自己和您的博客保持平穩運行!
This is the next installment of這是下一個分期付款的 30 Wordpress Hacks in 30 Days 30 WordPress的技巧30天內 , and though we may be just a day or two behind in the deployment - we are definitely not short on content! ,雖然我們可能只是一,兩天後在部署-我們絕對不是短期的內容! Be sure to view all 30 days to make the most of your Wordpress blog!一定要查看所有30天,使大部分的WordPress的博客!
Today I’m going to write about one of the most important and most overlooked things you need to know as a Wordpress site owner - your database.今天,我要去寫的一個最重要和最忽視的事情,您需要了解作為一個WordPress的網站所有者-您的數據庫。 I would say the greater percentage of bloggers, even if they are bit geeky or techie, aren’t “database savvy”.我要說的更大比例的博客,即使它們有點怪異或技術人員,不是“數據庫精明” 。 It’s no different than driving a car but not knowing much about the mechanics or maintenance of it.這沒有什麼不同開車,但不知道這麼多力學或維修的。 You don’t know what nobody ever told you - so consider today your lesson in “how to maintain and backup your wordpress database”.你不知道沒有人告訴你-所以今天審議的教訓, “如何維護和備份您的W ordPress的數據庫” 。 Maintenance in necessary to ensure the backend of your site runs smooth, backup is necessary in case you have a disaster, move hosts, get corrupted files, or (god forbid) you screw it up hacking it yourself!在必要的維修,以確保後端您的網站運行順利,備份是必要的,如果你有一個災難,移動主機,讓損壞的文件,或(上帝保佑) ,您螺釘它黑客它自己吧!
It’s not hard, in fact it’s about as painless as changing your oil in your car.這並不難,實際上它是作為無痛改變你的油你的車。 What I’m going to show you is how to do “preventative maintenance” for your Wordpress DB (database).什麼我要告訴你是如何做“預防性維護”為您的WordPress的數據庫(數據庫) 。 People who are hackers, or programmers, or uber-geeks either login to the command line in telnet (very geeky!) to maintain their telnet database.人們誰是黑客,或程序員,或超級愛好者或者登錄到命令行遠程登錄(非常怪異! )保持其遠程登錄數據庫。 More popular is to login to your web host control panel for your site and use myPHPAdmin to graphically administer and maintain your Wordpress mySQL database.更受歡迎的是登錄到您的網頁主機控制面板,為您的網站和使用,以生動myPHPAdmin管理和維護你的WordPress的MySQL數據庫。
There are two Wordpress plugins that I use that help me with Wordpress maintenance.有兩個WordPress的插件,我使用,幫助我WordPress的維修。 The first is the首先是 Diagnosis plugin診斷插件 . 。 This plugin doesn’t “do” anything except give you information about your site and the web host you are on.這插件不“做”什麼,除非讓您了解您的網站和網頁主機您是。 The first reason this plugin is invaluable is because it gives you a reference for information you might not ordinarily know.第一個原因此插件是非常寶貴的,就是因為它給你的參考信息您可能通常不知道。 Do you know what version of PHP you have?你知道什麼版本的PHP嗎? Do you know your mySQL encoding type?你知道你的MySQL編碼類型? Do you know your mySQL IP address and port number?你知道你的MySQL IP地址和端口號碼是多少? These are all things you might need to know for installing script or troubleshooting your site in the future.所有這些東西你可能需要知道安裝腳本或疑難排解您的網站的未來。 The main reason I have Diagnosis installed is because it gives me 3 pieces of information about my database load that I check out either once a week, or if my Wordpress blog starts acting funny (with errors or database connection).最主要的原因我已經安裝的診斷是因為它給了我3個有關我的數據庫負載,我退房或者每週一次,或如果我的WordPress的博客開始代理有趣的(有錯誤或數據庫連接) 。

In my WP dashboard I go to “Dashboard -> Diagnosis” and look at the mySQL load section to briefly check out the load.在我國可濕性粉劑的儀表板我去“控制台-> ”診斷“ ,並期待在M ySQL的負載部分簡要地檢查了負荷。 The more traffic you have, and the more database intense your pages are, the higher the load will be.在更多的流量你,和更激烈的數據庫,您的網頁,較高的負荷將。 The amount of beating a mySQL database server can take is much different on a “shared host” vs. a VPS (virtual private server) or dedicated box.數額毆打MySQL數據庫服務器可以採取很多不同的關於“共同主辦”同期定位系統(虛擬專用服務器)或專用盒。 Shoemoney recently wrote about the fact that his Wordpress blog recently had to go to it’s own decidated server box, but it probably gets 1,000 times the traffic I do daily. Shoemoney最近寫的事實,他WordPress的博客最近到它自己的decidated服務器中,但它可能獲得1000倍的流量我每天。 The most important figure here to me is the “connection success rate”.最重要的數字,我這裡是“連接的成功率。 ” If it’s not 99.9% - you have a problem.如果沒有99.9 % -你有問題。 Either you have more traffic than your server can handle, too many connections, or something corrupted with the database.要么你擁有更多的流量比您的服務器能夠處理,太多的聯繫,或者損壞的數據庫。
I think the most common problem that happens is your Wordpress site loses connection with the DB and you get some kind of Wordpress error from your site (in a browser) that says “error connecting to database).我認為,最常見的問題,這種情況是你的WordPress的網站失去聯繫的數據庫,你會得到某種形式的WordPress的錯誤從您的網站(在瀏覽器中) ,顯示“錯誤連接到數據庫) 。 One thing you may not realize is that when you get “shared web hosting” for $3.99 - $24.99 per month the “shared” part of the hosting is the web server and the database server.有一件事您可能沒有意識到,當你“共享網絡託管”為3.99美元-2 4.99美元,每月的“共享”的一部分,主辦是W eb服務器和數據庫服務器。 In other word, www.yoursite.com is physically on a server sharing that computers resources with hundreds of other web sites.在其他字,身體www.yoursite.com服務器上的共享計算機資源,數以百計的其他網站。 Your mySQL database is more than likely on a different server, and all it does is host databases.你的MySQL數據庫更可能在不同的服務器,以及所有它是主機數據庫。 Even if your web server resources are underutilized, your database server might be maxed out by a very busy (or inefficient) site.即使您的網絡服務器資源不足,您的數據庫服務器可能是由當初的一個非常繁忙(或低效)的網站。 If you get database errors or have connection problems the first thing I would do would be to see what your connection success rate is, and if it’s bad call your host and ask about the “health” of the mySQL server you’re using.如果你數據庫錯誤或連接問題的第一件事我想這樣做將看到您的連接成功率,如果它的不良要求你的主機,並詢問“健康” MySQL服務器的使用。 You might find (like I have on some occasions) that another customer (on that DB server) is killing your site.您可能會發現(如我曾在一些場合) ,另一個客戶(在該數據庫服務器)是造成您的網站。
This post has multiple pages...這個職位有多個頁...
- Maintaining Your Wordpress Database 維護您的WordPress的數據庫
- Page 2 - How to Maintain a Wordpress Database第2頁-如何保持W ordPress的數據庫
- Page 3 - How to Backup a Wordpress Database第3頁-如何備份W ordPress的數據庫
- View All查看全部
Tags:標籤: backup備份 , , database數據庫 , , help幫助 , , optimize優化 , , plugin插件 , , tutorial教程 , , wordpress-hacks WordPress的,黑客




















April 25th, 2008 at 10:16 am 08年四月25日在上午10時16
Very useful post JT.非常有用的後特魯利。
Q
Is DB-manager compatible with 2.5?是的DB -經理兼容2.5 ? Shows only 2.3 on the site, are you using it now with your 2.5?顯示,只有2.3網站上,你是用它與您現在的2.5 ?
The diagnosis part is great!診斷部分是太棒了! Noobs like me to WorPress don’t think about stuff like that. Noobs要我WorPress沒有想到的東西一樣。 Very important!很重要的! And a good plugin.和一個很好的插件。
Do you really see an advantage over backing up the database vs just exporting the information out of WordPress?你真的看到了優勢,備份的數據庫與公正的信息出口的WordPress的?
I just zip my site every so often and export from WordPress.我只是壓縮我的網站都經常和出口從WordPress的。 I also keep a DB backup because I’m paranoid我還保持數據庫的備份,因為我偏執
but it does seem a little redundant.但它似乎有點多餘。 So far I’ve only used the export/import of wordpress to set things back up.迄今為止我只用來出口/進口的WordPress的設置備份的東西。 When I’ve toasted the DB.當我已經烤數據庫。 . 。 . 。 yes I have done it already.是我已經做了。 . 。 . 。 gotta learn some way.總得學習一些方法。 Anyway, I’ve just imported again and I’m right back to where I was.不管怎樣,我剛才再次進口,我右後衛,以我在那裡。
Just an idea for us noobs只是一個想法,我們noobs
Thanks for the DB education!謝謝您的數據庫教育!
C ç
Acupunctures last blog post.. Acupunctures最後的博客帖子.. The Science of Getting Rich by Wallace Wattles科學致富的華萊士沃特爾斯
April 28th, 2008 at 12:03 pm 2008年四月28號在下午12時03
I really enjoy this wordpress hacks series.我很喜歡這個WordPress的黑客系列。 I’m no programmer and even I can understand and use this.我不是程序員,甚至我能理解和使用這一點。
On a related note (kind of在一個相關的說明(種
I Made My First BANS Sale!!!我在我的第一個禁止銷售!
Just wanted everyone to know I made my first BANS sale today!只是希望每個人都知道我在我的第一個禁止出售今天!
I did the following to make it happen.我沒有下面做到這一點。
1. 1 。 Used Rochelle’s “The Niche Store Checklist has been Revised” to create the BANS site.使用拉羅謝爾的“生態商店清單已修訂後的”創造禁止的網站。 http://www.nichestorestrategies.com
2. 2 。 Used Marks’s “More Free Build a Niche Store templates - Come and Get Em!” to build the site.使用商標的“更自由建設生態店鋪模板-來獲取阿姆! ” ,以建立網站。 http://www.thenichestorebuilder.com
3. 3 。 Used JTPratt’s “Watch Me Build a BANS Niche Site from Scratch!” to fine tune the site.使用JTPratt的“看我建立一個網站禁令利基從頭開始! ”微調網站。 http://www.jtpratt.com
4 Used JTPratt’s “Best Practices for Setting Up a New Wordpress blog in 60 Minutes or less” to set up a blog correctly.第4用JTPratt的“最佳做法設立一個新的WordPress的博客在60分鐘或更少”建立一個博客正確的。 http://www.jtpratt.com
Thanks to all the forum posts at BANS and all the people who commented on the sites listed above.感謝所有論壇職位禁令和所有的人誰評論的網站上面列出。
Come take a look來看看 http://www.toolboxhero.com and make relevant comments at並提出相關的意見 http://www.toolboxhero.com/blog . 。 The blog is dofollow so go ahead and build some backlinks.該博客是dofollow所以要大膽向前,並建立一些反向。
Next, more backlinks, more BANS stores, and implement more ideas from Rochelle.其次,更多的反向,更禁止商店和實施更多的想法拉羅謝爾。 Mark, and JTPratt!!馬克,並JTPratt !
Thanks again, Paul再次感謝,保羅
Pauls last blog post..保羅最後的博客帖子.. Sears Normal Tool Warranty西爾斯正常保修工具
June 5th, 2008 at 9:04 am 2008年6月5日在上午09時04分
[...] a nice article by JTPratt, his next step was installing WP-DBManager which will provide a new screen in your dashboard with [...] [...]很好的文章JTPratt ,他的下一步是安裝渦噴DBManager這將提供一個新的屏幕在您的儀表板與[...]
August 25th, 2008 at 3:31 am 2008年八月25日在上午03時31分
I have to agree that backing up your database is a pain, but very important.我不得不同意,備份你的數據庫是一個痛苦,但非常重要的。 I read a post on a forum, that I frequent, today.我讀了後的一個論壇,我頻繁的今天。 From someone who got their blog hacked.從別人誰得到他們的博客砍死。 It’s just much easier to recover from that if things are backed up.這只是更容易恢復過來,如果事情後盾。
Sid Softwares last blog post..希德軟件上的博客帖子.. Best Windows backup software最佳Windows備份軟件
August 27th, 2008 at 12:02 am 2008年8月27日在上午12點零二
[...] don’t feel bad. It didn’t mean anything to me either when I came across it over at JT Pratt’s Blogging Mistakes (currently my favorite blog about blogging). You can follow the link to his excellent explanatory [...] [...]不覺得bad.Â它並不意味著什麼,我都當我碰到它在日本煙草公司普拉特的博客誤區(目前我最喜愛的博客有關Blog ) 。 A您可以按照鏈接他出色的解釋性[...]
September 10th, 2008 at 4:29 pm 2008年9月十日在下午4點29
first off i want to thank you for the marvelous article…it is very clear and even i could “get it”….however, i have done everything you suggested and i am still loading slow….首先,我要感謝你的精彩文章...這是非常明確的,甚至我可以“得到” ... 。不過,我已經盡你建議我仍然加載緩慢... 。
i have also taken all the text off of you widgets, deleted all on active plug ins…我還採取了所有的文字從你構件,刪除了所有關於積極插件...
i have done everything i have read about other than the cashe and i am so unfamiliar with that it sort of scares me…我已經盡我已閱讀有關以外的其他cashe和我很熟悉,它那種害怕我...
could you please please help me….i have bugged my hosting company many times….and they said there is nothing else they can do….你可以請幫我... 。我有竊聽我的託管公司多次... 。他們說,他們沒有別的可以做... 。
so any imput would be very appreciated.因此,任何輸入將是非常讚賞。
thanks謝謝
darlene
September 10th, 2008 at 10:03 pm 08年九月10日在下午10時03
@Darlene - @ Darlene -
Looks like you have multiple issues.看起來像您有多個問題。 I have had this exact same problem and fixed it.我有這個相同的問題和固定它。 I think you have a plugin conflict and also you have massive code issues.我想你有一個插件衝突,還您有大量的代碼問題。
This is what I would do…這就是我將盡...
1. 1 。 Disable all plugins禁用所有插件
2. 2 。 Set the theme to default設置默認主題
3. 3 。 Take your July 15th post and edit it.你7月15日員額和編輯。 Copy the text into Windows notepad.複製文本到Windows記事本。 Use Ctrl-A to “select all” and copy, then go back to the post in your Wordpress dashboard.使用Ctrl - A至“選擇所有”和複製,然後再返回後在您的WordPress的儀表板。 Delete everything.刪除一切。 Paste the text you copied from notepad.貼上您複製文本從記事本。 The problem is you’ve been writing your entries in Microsoft Word, copying the text and pasting it into your posts using the Wordpress visual editor.問題是您一直在寫你的作品在Microsoft Word中,複製的文本並粘貼到您的文章使用WordPress的可視化編輯器。 You have to stop doing that - it’s bloating the bejeezus out of your code.你必須停止這樣做-這是腹脹的b ejeezus了您的代碼。
4. 4 。 Save the post, reload your home page保存後,重新載入您的主頁
At this point everything should be better.在這一點上都應該做得更好。 If it’s not, download all your plugins to your desktop in folder, then in FTP on your web server delete all the plugins in /wp-content/plugins.如果不是的話,下載所有的插件到桌面的文件夾,然後在您的FTP網絡服務器刪除所有的插件在/ wp-content/plugins 。 Wordpress still looks in your plugin directory - even if they aren’t enabled. WordPress的仍然期待您的插件目錄-即使他們是沒有啟用。
So now, what happens?所以,現在會發生什麼? Your blog should be light years faster.您的博客應該光年的速度更快。 If it’s STILL not you may have a web host problem.如果它還是您可能有一個網頁主機的問題。 There may be too many people on your web server or the MySQL (database server) might be overused.可能有太多的人對您的Web服務器或在MySQL (數據庫服務器)可能是過度。 I mean, if you have the default them with no plugins your blog still takes 30 seconds to load, unless you have serious database corruption your web host is to blame.我的意思是,如果您有默認他們沒有插件您的博客仍然需要30秒鐘加載,除非你有嚴重的腐敗數據庫您的網頁主機的錯。 You already optimized your database - so it should be ok.您已經優化你的數據庫-因此它應該確定。
At this point, I would dump your web host for someone like在這一點上,我將轉儲您的網頁主機的像 Hostgator . 。 I use them for about everything, they work great, and you can have unlimited sites and databases for $15/mo or less.我使用他們的一切,他們的工作很好,你可以擁有無限的網站和數據庫,為15/mo或更少。 The servers are fast, tech support is great, and I’ve never had any issues with anything - EVER.該服務器的速度快,技術支持是巨大的,我從來沒有任何問題,任何-恆。
Post again on your success (or failure) once you’ve tried these steps…郵政再次你的成功(或失敗)一旦你試過這些步驟...
September 10th, 2008 at 11:23 pm 2008年9月十日在下午11點23分
hi there…高科技有...
thanks for your comments…i have done the plugin thingy…i am afraid to do the default as i didn’t build that part of my website….and don’t know if i could get it back without a lot of tears….and i have really spent them all on this issue….謝謝您的意見...我也做了插件thingy ...我怕這樣的默認,我沒有建立這一部分我的網站... 。和不知道我是否能回來沒有很多的眼淚... 。我真的度過他們都在這個問題上... 。
i do want you to tell me more in detail about my posting behavior….and you are right in what i am doing….and i know for you you probably felt it was in detail…but i need it sort of step by step….how do i write my articles….in notebook and then copy them into wordpress???我想你告訴我更詳細了解我張貼的行為... 。和你是什麼權利,我這樣做... 。而且我知道你,你可能認為這是詳細...但我需要的那種一步一步... 。如何我寫我的文章... 。在筆記本,然後將其複製到WordPress的? ? ? how do i get the various styles i like in my writing….do i have to give that up???…我如何獲得各種風格我喜歡在我的寫作... 。我一定要給予了? ? ? ...
also i finally got a senior service rep and he went to the top and found out that one of data servers (the second one or something) was/is the problem and my issue is suppose to resolved by morning…i made 6 calls to them and asked about the server thingy each time and each time they just repeated that the server load was checked and it was ok….evidiently there are two servers and they didin’t take it that far….我也終於獲得了高級服務代表和他到頂端,發現一個數據服務器(第二一人或東西)是/是這個問題,我的問題是假設,以解決...今天上午,我6呼籲他們並詢問該服務器thingy每次每次他們只是重申,服務器負載的檢查,並確定這是... 。 evidiently有兩個服務器和他們didin't是否可以認為到目前為止... 。
so will lst you know what happens in the morning…and i really, really appreciate your answer and thoroughness in helping me…you are great!!!!!所以將首屆你知道發生在今天上午...我真的,真的非常感謝您的回答和徹底性,幫助我...您是偉大的!!!!!
namaste, namaste ,
darlene
September 11th, 2008 at 7:50 am 08年9月11號在上午七點50分
Darlene, Darlene ,
I checked your site also.我檢查您的網站還。 I don’t think it has anything to do with the plugins or themes.我不認為這有什麼關係的插件或主題。
If you watch your browser working you will see that it is waiting to connect to the domain and once it does it loads the page rather fast.如果您看您的瀏覽器的工作你會看到,它正在等待連接到域,一旦它加載網頁較快。 Therefore, the problem.因此,這一問題。 . 。 . 。 in my opinion is your host.在我看來,是您的主機。
Hostgator is a good host I also like Hawk Host - very good and low cost. Hostgator是一個很好的東道國我也喜歡鷹主機-非常好,成本低等優點。
One of my sites responds like yours at times.我的一個網站像您這樣的回應時。 . 。 . 。 thus it isn’t my plugins or theme.因此,這不是我的插件或主題。 It’s whatever is going on with your host at that time.這一切正在與你的主機在這個時間。
Good luck祝您好運
September 11th, 2008 at 8:46 am 08年九月十一日在上午08點46分
@Darlene: What you need to do is never write posts in anything other than Wordpress from now on. @ Darlene :你需要做的是從來沒有寫職位以外的任何WordPress的從現在開始。 Make sure you are using the “visual” editor (the one with bold, italic, font size, bullets, etc).請確保您使用的是“視覺”編輯器(在一個粗體,斜體,字體大小,子彈等) 。 If you aren’t - edit your profile under “Users” and enable it.如果您不是-編輯您的個人資料下的“用戶” ,並啟用它。
If there are things in Word you want to do that Wordpress visual editor won’t - you should be doing those in web pages anyway.如果有東西在Word中要做到這一點WordPress的可視化編輯器將不會-你應該做的是在網頁上反正。 Microsoft Word adds in 50X more code (most of it useless) for every page you write - making the load times slower.微軟Word 50X增添更多的代碼(其中大部分是無用的)的每一頁你寫-使加載時間慢。 Not a ton slower, but slower.一噸不慢,但慢。
To fix the existing posts you just open up Windows Notepad by going to start->Accessories ->Notepad.要修復現有員額您剛剛打開Windows記事本的要啟動“配件-> ”記事本。 Just copy your posts there.只需複製您的帖子出現。 Select all, and then copy again, and paste back to your post and save.選擇所有,然後再複製,並貼到您的文章和保存。