How to Read MySQL Binary Log Files (BinLog) with mysqlbinlog कैसे mysqlbinlog के साथ MySQL द्विचर लॉग फ़ाइलें (BinLog) को पढ़ें
MySQL database server generates binary log files for every transaction to the databases, provided administrator does not disable or comment out the “log-bin” parameter in my.cny configuration file. MySQL डाटाबेस सर्वर डेटाबेस के लिए प्रत्येक लेनदेन के लिए द्विआधारी लॉग फाइल उत्पन्न करता है, बशर्ते प्रशासक या निष्क्रिय कर बाहर नहीं "प्रवेश बिन टिप्पणी है my.cny विन्यास फाइल में पैरामीटर". The binary log files are written in binary format. द्विआधारी लॉग फ़ाइलें बाइनरी स्वरूप में लिखा है. Although the binary logs, or also known as logbin are mainly used for MySQL database replication purpose, sometimes you may need to examine or read the contents of binary logs in text format, where the mysqlbinlog utility will come in handy. हालांकि द्विआधारी लॉग करता है, या यह भी logbin रूप में जाना जाता मुख्यतः MySQL डेटाबेस प्रतिकृति उद्देश्य के लिए इस्तेमाल किया हो, कभी कभी आप जांच या पाठ प्रारूप में द्विआधारी लॉग की सामग्री पढ़ जहां mysqlbinlog उपयोगिता काम में आ जाएगा ज़रूरत हो सकती है.
Binary log file, which normally has name with the format host_name-bin.xxxxxx and store in /var/lib/mysql directory, could not be opened and read straight away as it's in unreadable binary format. द्विआधारी लॉग फ़ाइल, / जो सामान्य प्रारूप host_name-bin.xxxxxx में और दुकान के साथ नाम है var / lib / mysql निर्देशिका, और नहीं खोला सीधे पढ़ने के रूप में यह अस्पष्ट द्विपदीय प्रारूप में है हो सकता है. To read the binary logs in text format, we can make use of mysqlbinlog command, which also able to readrelay log files written by a slave server in a replication setup. को पाठ प्रारूप में द्विआधारी लॉग पढ़ा, हम आदेश है, जो भी प्रवेश एक प्रतिकृति सेटअप में एक गुलाम सर्वर ने लिखा फ़ाइलें readrelay कर mysqlbinlog का उपयोग कर सकते हैं. Relay logs have the same format as binary log files. रिले लॉग द्विआधारी लॉग इन फ़ाइलों के रूप में ही स्वरूप है.
To use mysqlbinlog utility is simple, simply use the following command syntax to invoke mysqlbinlog after login in as root (else you have to specify user name and password) to shell via SSH: Mysqlbinlog उपयोगिता का उपयोग करने के लिए आसान, बस निम्न कमांड का प्रयोग है वाक्यविन्यास में प्रवेश के बाद mysqlbinlog आह्वान रूट के रूप में (और आप के लिए उपयोगकर्ता नाम और पासवर्ड निर्दिष्ट है) को ssh द्वारा खोल:
mysqlbinlog [options] log_file ...
So to read and display the contents of the binary log file named binlog.000001, use this command: तो और पढ़ने के लिए द्विआधारी प्रवेश की सामग्री प्रदर्शित फ़ाइल binlog.000001 नाम, इस कमांड का उपयोग करें:
mysqlbinlog binlog.000001
The binary log files and its data are likely to be very huge, thus making it almost impossible to read anything on screen. द्विआधारी लॉग इन फ़ाइलों और डेटा के लिए बहुत बड़ी हो सकती हैं, इस तरह यह लगभग स्क्रीन पर कुछ पढ़ने असंभव बना. However, you can pipe the output of mysqlbinlog into a file which can be open up for later browsing in text editor, by using the following command: लेकिन, आप एक फाइल हो जो बाद में पाठ संपादक में ब्राउज़िंग, निम्न कमांड का प्रयोग कर के लिए खोल सकते में mysqlbinlog के उत्पादन में पाइप कर सकते हैं:
mysqlbinlog binlog.000001 > filename.txt
To reduce the amount of data retrieved from binary logs, there are several options that can be used to limit the data that is been returned. द्विआधारी करने के लिए लॉग से प्राप्त आंकड़ों की मात्रा को कम करने, वहाँ कई विकल्पों के लिए डेटा वापस आ गया है कि सीमा इस्तेमाल किया जा सकता है. Among the useful ones are listed below: उपयोगी वालों में नीचे सूचीबद्ध हैं:
–start-datetime=datetime -शुरू DateTime DateTime =
Start reading the binary log at the first event having a timestamp equal to or later than the datetime argument. पहले कोई टाइमस्टैम्प के बराबर या बाद वाले समारोह में द्विआधारी लॉग पढ़ना शुरू DateTime तर्क से. The datetime value is relative to the local time zone on the machine where you run mysqlbinlog. DateTime मूल्य मशीन पर स्थानीय समय क्षेत्र के सापेक्ष तुम कहाँ mysqlbinlog चला है. The value should be in a format accepted for the DATETIME or TIMESTAMP data types. मूल्य एक DateTime या टाइमस्टैम्प डेटा प्रकार के लिए स्वीकार किए जाते हैं प्रारूप में होना चाहिए. For example: उदाहरण के लिए:
mysqlbinlog --start-datetime="2005-12-25 11:25:56" binlog.000001
–stop-datetime=datetime -रोकने DateTime = DateTime
Stop reading the binary log at the first event having a timestamp equal or posterior to the datetime argument. बंद करो पहले एक समान या DateTime तर्क के पीछे टाइमस्टैम्प वाले समारोह में द्विआधारी लॉग पढ़ने. This option is useful for point-in-time recovery. इस विकल्प का बिंदु के लिए उपयोगी में समय वसूली है. See the description of the –start-datetime option for information about the datetime value. -DateTime मूल्य के बारे में जानकारी के लिए शुरू DateTime विकल्प का वर्णन देखें.
–start-position=N -शुरू की स्थिति N =
Start reading the binary log at the first event having a position equal to the N argument. पहले कोई एन तर्क के बराबर होने की स्थिति समारोह में द्विआधारी लॉग पढ़ने शुरू करो. This option applies to the first log file named on the command line. इस विकल्प का पहला लॉग इन पर लागू होता है कमांड लाइन पर फ़ाइल नाम.
–stop-position=N -रोकने की स्थिति = N
Stop reading the binary log at the first event having a position equal or greater than the N argument. बंद करो पहले एक समान स्थिति या एन तर्क से अधिक होने समारोह में द्विआधारी लॉग पढ़ने. This option applies to the last log file named on the command line. इस विकल्प को पिछले लॉग इन पर लागू होता है कमांड लाइन पर फ़ाइल नाम.
For more usage information on mysqlbinlog, visit Mysqlbinlog, यात्रा के बारे में अधिक जानकारी के लिए उपयोग here यहां . .
IMPORTANT : The page is machine translated and provided "as is" without warranty. महत्वपूर्ण: पृष्ठ की मशीन है और अनुवाद प्रदान "के रूप में वारंटी के बिना है." Machine translation may be difficult to understand. मशीन अनुवाद मुश्किल से समझ सकते हो. Please refer to कृपया उल्लेख करने original English article मूल अंग्रेजी लेख whenever possible. जब भी संभव है.
Related Articles संबंधित लेख
- Reset the Root Password of MySQL Server MySQL सर्वर के रूट पासवर्ड रीसेट करें
- Change and Reset MySQL root Password परिवर्तन और रीसेट MySQL रूट पासवर्ड
- How to Backup and Restore (Export and Import) MySQL Databases Tutorial बैकअप और पुनर्स्थापित करने के लिए कैसे निर्यात (और आयात) MySQL डेटाबेस ट्यूटोरियल
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 – Part 3 Apache स्थापित वेब 2.2, 5.0 MySQL और 5 PHP के साथ 6.0 FreeBSD में सर्वर - भाग 3
- Read It Later यह बाद में पढ़ें
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 – Part 5 Apache स्थापित वेब 2.2, 5.0 MySQL और 5 PHP के साथ 6.0 FreeBSD में सर्वर - भाग 5
- Disable Auto Go To (Jump) To Read More Tag अक्षम ऑटो (Jump) को और अधिक टैग को पढ़ने के लिए जाओ
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 – Part 4 Apache स्थापित वेब 2.2, 5.0 MySQL और 5 PHP के साथ 6.0 FreeBSD में सर्वर - भाग 4
- Encouraging Toddlers to Read with LeapFrog's Tag Junior Pal प्रोत्साहित Toddlers है मेंढक कूद टैग जूनियर पाल के साथ पढ़े
- Check and Optimize MySQL Database Automatically with Crontab/Cron जाँच करें और अनुकूलन MySQL Crontab के साथ स्वत: डाटाबेस / Cron










































September 5th, 2009 05:04 5 सितम्बर 2009 05:04
don't forget (as i did) to execute mysqlbinlog with a user that has permission to read the binlog or sudo works nicely too. भूल जाते हैं जैसा कि मैंने क्या किया नहीं () के लिए एक प्रयोक्ता जो binlog या sudo पढ़ने की अनुमति है साथ mysqlbinlog निष्पादित भी अच्छी तरह से काम करता है.
June 29th, 2008 16:33 29 जून 2008 16:33
This post saved my life today… when the binary log were the only way to retrieve important data get lost… thanks!! इस पोस्ट में आज मेरी जान बचाई ... जब द्विआधारी लॉग एकमात्र तरीका महत्वपूर्ण डेटा पुनः प्राप्त किया गया खो ... धन्यवाद हो!