Enable Logging of Slow Queries (Slow Query Log) in MySQL Database Aktivieren der Protokollierung von Slow-Abfragen (Slow Query Log) in der MySQL Datenbank

One of the main requirements for a fast Eine der wichtigsten Voraussetzungen für eine schnelle web server Web-Server is to has efficient and effective SQL statements or queries that are optimized. ist es, hat effiziente und effektive SQL-Statements oder Fragen, die optimiert werden. Any non-optimal SQL (Structured Query Language) commands or statements that take too long or lengthy time to execute will use up a lot of system resources, causing Jede Nicht-optimale SQL (Structured Query Language)-Kommandos oder Aussagen, die zu lange dauern oder lange Zeit zur Ausführung wird eine Menge von System-Ressourcen, wodurch MySQL database to run slower, and then more and more queries backlogs queuing up, and when connection limit is reached, visitors are been denied or refused connection. Datenbank langsamer zu laufen, und dann mehr und mehr Anfragen Rückstau Schlange stehen, und wenn eine Verbindung Grenzwert erreicht ist, werden die Besucher wurden verweigert oder abgelehnt Verbindung. In worst case scenario, your web server will go down as well, or continuously underperform. Im schlimmsten Fall, Ihren Web-Server gehen wie gut oder kontinuierlich Underperform. The case is especially true when you are using MyISAM table type which uses table-level locking instead of row-level locking in a high traffic website. Der Fall ist besonders der Fall, wenn Sie mit MyISAM-Tabellentyp verwendet die Tabelle-Level Locking statt row-level Locking in einer hohen Besucherzahl.

Sometime, a single SQL query may be the cause of all the server’s problems. Irgendwann, eine einzige SQL-Abfrage kann die Ursache für alle Server-Probleme. MySQL has built-in functionality to capture slow query log or identify queries that are not optimal and take a long time to finish, which allows you to log all slow running queries which took over defined number of seconds to execute by MySQL database engine to a file. MySQL verfügt über integrierte Funktionen zum Erfassen von langsamen Abfrage-Protokoll oder identifizieren Suchanfragen, die nicht optimal sind und viel Zeit in Anspruch nehmen zu beenden, mit dem Sie sich anmelden alle langsam laufenden Abfragen übernahm die definierte Anzahl von Sekunden zur Ausführung von MySQL-Datenbank-Engine zu einem Datei. Slow query log is not activated or on by default MySQL installation, thus it is one of the less-used logs. Slow-Log-Abfrage ist nicht aktiviert oder auf standardmäßig MySQL-Installation, so ist es eine der weniger verbreiteten Protokolle.

To enable slow query log, simply add the following line to MySQL configuration file (my.cnf or my.ini), and then restart the MySQL server: Damit langsame Abfrage-Log, fügen Sie einfach die folgende Zeile zu MySQL Konfigurationsdatei (my.cnf oder my.ini), und starten Sie den MySQL-Server:

log-slow-queries

or oder

log-slow-queries = [path to the log file] log-slow-queries = [Pfad zur Log-Datei]

Replace [path to the log file] with actual path to the slow query log file you want the MySQL to write the log to, which is the optional value. Ersetzen Sie [Pfad zur Log-Datei] mit den tatsächlichen Pfad zu dem langsamen Abfrage Log-Datei, die Sie wollen, dass die MySQL zu schreiben, das Protokoll zu, das ist die optionale Wert.

Or you can start mysqld with with the –log-slow-queries[=file_name] option to enable the slow query log. Oder Sie können starten mysqld mit der-log-slow-queries [= file_name]-Option, damit die langsame Abfrage-Log. In both syntaxes, if not log file name is specified, the default name is host_name -slow.log, stored in the MySQL data file directory. In beiden Syntaxarten, wenn nicht Log-Datei angegeben ist, wird automatisch die Standardnummer Name ist host_name-slow.log, gelagert in der MySQL-Daten-Datei-Verzeichnis. If a filename is given, but not as an absolute pathname, the server writes the file in the data directory too. Wenn ein Dateiname angegeben wird, aber nicht als absolute Pfadnamen, schreibt der Server die Datei im Verzeichnis Daten zu.

After enabling slow query log, MySQL will create, capture and log to the log file with all SQL statements that took more than long_query_time seconds to execute, which is by default set to 10 seconds. Nach dem Aktivieren von langsamen Abfrage-Log, MySQL erstellen, erfassen und melden Sie auf die Log-Datei mit allen SQL-Anweisungen, die mehr als long_query_time Sekunden ausführen, das ist standardmäßig auf 10 Sekunden. The time to acquire the initial table locks is not counted as execution time. Die Zeit für die Anschaffung der ersten Tabelle Sperren nicht gezählt, wie die Ausführungszeit. mysqld writes a statement to the slow query log after it has been executed and after all locks have been released, so log order might be different from execution order. schreibt mysqld eine Erklärung zu den langsamen Abfrage anmelden, nachdem es ausgeführt wurde und nachdem alle Sperren wurden freigegeben, so dass log, um möglicherweise andere aus, um die Ausführung.

You can then examine all the SQL queries that took longer than the pre-defined number of seconds (10 seconds by default) in the host_name -slow.log, and then take the necessary steps to optimize the SQL statements. Sie können dann prüfen, die alle SQL-Abfragen, dauerte länger als die vorher festgelegte Anzahl von Sekunden (10 Sekunden per default) in der host_name-slow.log, und dann die notwendigen Schritte zur Optimierung der SQL-Anweisungen. The slow query log will tell you about what was time the query completed, how long the query took to run, how long it took to secure its locks, how many rows were sent back as a result, how many rows were examined to determine the result, which database was used, and the actual query itself. Der langsame Abfrage-Log wird Ihnen sagen, was an der Zeit war die Abfrage abgeschlossen, wie lange die Suche dauerte zu laufen, wie lange es dauerte, um seine Schleusen, wie viele Zeilen wurden wieder als Ergebnis, wie viele Reihen wurden geprüft, um festzustellen, die Ergebnis der Datenbank verwendet wurde, und die tatsächliche Abfrage. But bear in mind that a SQL query contained in the log may have already optimum, but executed slowly due to the system resources been used up by the actual slow statement that need to be fine tuned. Aber bedenken, dass eine SQL-Abfrage in die Log-möglicherweise bereits optimal, aber langsam ausgeführt aufgrund der Systemressourcen verwendet wurden durch die tatsächliche Feststellung, daß langsam müssen feingetunt.

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. WICHTIG: Es handelt sich um eine Maschine der Seite übersetzt wird "as is" ohne Garantie. Machine translation may be difficult to understand. Maschinelle Übersetzung ist vielleicht schwierig zu verstehen. Please refer to Bitte wenden Sie sich an original English article Original Englisch Artikel whenever possible. wann immer dies möglich ist.

Share and contribute or get technical support and help at Aktie und einen Beitrag oder erhalten technische Unterstützung und Hilfe an My Digital Life Forums Meine digitalen Lebens Foren . Werden.



One Response to “Enable Logging of Slow Queries (Slow Query Log) in MySQL Database” One Response to "Enable Logging von Slow-Abfragen (Slow Query Log) in der MySQL Datenbank"

  1. Change or Set MySQL Long Query Time Value for log-slow-queries » My Digital Life Ändern oder Set MySQL Query Time Long Wert für log-slow-queries »Mein Digital Life
    January 23rd, 2007 00:22 23. Januar 2007 00:22
    1

    [...] If you enable slow queries log of MySQL database server, you will notice that from the slow query log file contains only SQL statements and queries that took more than query_time of 10 seconds to execute or run. [...] Wenn Sie langsam, damit Anfragen-Log von MySQL Datenbank-Server, werden Sie feststellen, dass von den langsamen Abfrage-Log-Datei enthält nur SQL-Anweisungen und Abfragen, die mehr als query_time von 10 Sekunden auszuführen oder ausführen. This is the default value or query time threshold for log_slow_queries function, which is 10 seconds. Dies ist der Standardwert oder Query Time Schwelle für log_slow_queries Funktion, die ist 10 Sekunden. 10 seconds is way too long for a SQL query to complete, so the value may be too high to capture any meaningful data. 10 Sekunden sind viel zu lange für eine SQL-Abfrage abgeschlossen ist, so dass der Wert möglicherweise zu hoch, um eine sinnvolle Daten. You can alter or change the slow query time to lower value or number of seconds. Sie können ändern oder ändern Sie die Abfrage langsam Zeit zu niedrigeren Wert oder die Anzahl der Sekunden. You can set a new long_query_time in the MySQL configuration file, namely my.cnf or my.ini, normally located in /etc directory. Sie können einen neuen long_query_time in der MySQL-Konfigurationsdatei, nämlich my.cnf oder my.ini, die normalerweise in / etc-Verzeichnis. Simply add the following line to the configuration file: [...] Fügen Sie einfach die folgende Zeile in der Konfigurationsdatei: [...]

Leave a Reply Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> Sie können diese Tags: <a href= title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q Cite=""> <strike> <strong>

Subscribe without commenting Abonnieren ohne zu kommentieren


Custom Search

New Articles Neue Artikel

Incoming Search Terms for the Article Eingehender Suchbegriffe für den Artikel

enable slow query log damit langsame Abfrage-Log - -- mysql enable Slow Query Log MySQL Query ermöglichen Slow Anmelden - -- slow query log langsame Abfrage-Log - -- my.cnf slow log my.cnf langsam log - -- log slow queries Log langsame Abfragen - -- mysql long queries MySQL lange Abfragen - -- slow query log my.cnf langsame Abfrage-Log my.cnf - -- my.ini slow query log my.ini langsame Abfrage-Log - -- mysql slow query log MySQL-Log-Abfrage langsam - -- enable mysql log MySQL-Log aktivieren - -- Enable slow query Aktivieren Sie langsam Abfrage - -- mysql enable slow query log my.cnf mysql ermöglichen langsame Abfrage-Log my.cnf - -- slow query my.cnf langsame Abfrage my.cnf - -- my.cnf slow query my.cnf langsame Abfragen - -- mysql log slow queries my.cnf MySQL-Anfragen-Log langsam my.cnf - -- mysql enable query log MySQL-Log-Abfrage aktivieren - -- mysql slow query log my.cnf MySQL Query langsam log my.cnf - -- how to enable slow query log So aktivieren langsame Abfrage-Log - -- mysql turn on slow query log mysql wiederum auf langsamen Abfrage-Log - -- mysql long query MySQL lange Abfrage - -- log-slow-queries log-slow-queries - -- mysql enable log MySQL-Log aktivieren - -- mysql enable slow query logging MySQL-Abfrage ermöglichen langsam Protokollierung - -- mysql query log MySQL-Anfragen-Log - -- enable mysql query logging MySQL-Abfrage ermöglichen Protokollierung - -- log all mysql queries that slow down Log-alle MySQL-Abfragen, slow down - -- mysql enable logs MySQL-Protokolle ermöglichen - -- mysql turn on slow log MySQL wiederum auf langsamen log - -- log-slow-queries my.ini log-slow-queries my.ini - -- mysql slow query MySQL-Abfrage langsam - -- mysql log slow queries MySQL-Log-langsam-Abfragen - -- Enable the slow query log Aktivieren Sie die langsame Abfrage-Log - -- enable mysql logging MySQL-Protokollierung aktivieren - -- mysql query log my.ini MySQL-Anfragen-Log-my.ini - -- mysql logging turn on MySQL-Protokollierung einschalten - -- mysql long query log MySQL lange Abfrage-Log - -- slow query log mysql my.cnf langsame Abfrage-Log von MySQL my.cnf - -- my.ini long query time my.ini lange Query Time - -- MySQL slow queries my.ini MySQL-Abfragen langsam my.ini - -- my.cnf query log my.cnf-Abfrage-Log - -- enable slow query in mysql damit langsam Abfrage in MySQL - -- Query taking more than the threshold time, execution time = 92 secs. Abfrage, mehr als die Schwelle Zeit, Ausführung Zeit = 92 Sekunden. - -- log-slow-queries my.cnf log-slow-queries my.cnf - -- mysql log slow queries my.ini MySQL-Anfragen-Log langsam my.ini - -- mysql slow query log location MySQL Query langsam log Standort - -- mysql log sql queries MySQL-Log-SQL-Abfragen - -- enable mysql query log MySQL-Abfrage ermöglichen log - -- my.cnf slow-queries my.cnf slow-queries - -- mysql query capture MySQL-Anfragen-Capture - - -- enabling the slow query log in mysql ermöglicht die Abfrage langsam Log in mysql - --