Check and Optimize MySQL Database Automatically with Crontab/Cron Prüfen und Optimieren von MySQL-Datenbank automatisch mit crontab / Cron

MySQL is a very popular free yet powerful database system. MySQL ist eine sehr beliebte kostenlose noch leistungsfähige Datenbank-System. But even in great databases, the tables may get fragmented with overhead due to continuous update, or delete and insert operation on data stored in database. Aber auch in großen Datenbanken, die Tabellen kann es fragmentiert ist und die Gemeinkosten durch eine kontinuierliche Aktualisierung, oder zu löschen, und legen Sie am gespeicherten Daten in der Datenbank. Beside, it's also possibility that the databases may get corrupted. Außer, es ist auch möglich, dass die Datenbanken beschädigt. Thus, performing health check on database and optimize MySQL server regularly is an important task. So, Gesundheits-Check über die Durchführung und Optimierung von MySQL-Datenbank-Server regelmäßig ist eine wichtige Aufgabe.

It's a bit troublesome if the database administrators have to login to the server or launching the phpMyAdmin to optimize the databases one by one or table by table manually. Es ist ein bisschen problematisch, wenn die Datenbank-Administratoren müssen sich hier anmelden, auf den Server oder den Start der phpMyAdmin zur Optimierung der Datenbanken einzeln oder Tabelle Tabelle manuell. Sometimes DB admin may simply forgets to do the job or set the frequency of optimization to lesser times. Manchmal DB Admin einfach vergisst, den Job zu erledigen oder die Häufigkeit der Optimierung zu mal weniger. It's recommended that every tables in MySQL databases are checked at least once a day on a busy server. Es wird empfohlen, dass alle Tabellen in MySQL-Datenbanken sind mindestens einmal pro Tag auf einem stark ausgelasteten Server.

It's possible to automate the optimization of MySQL process by using crontab function in Linux/Unix/CentOS/FreeBSD. Es ist möglich, für die automatisierte Optimierung von MySQL-Prozess mit crontab-Funktion in Linux / Unix / CentOS / FreeBSD. The cron job to check and optimize MySQL databases can be created by using mysqlcheck client utility comes MySQL installation. Die cron-Job zu überprüfen und optimieren MySQL-Datenbanken erstellt werden können, indem Sie mysqlcheck-Client-Dienstprogramm kommt MySQL-Installation. mysqlcheck client can checks, repairs, optimizes, and analyzes tables in MySQL database. mysqlcheck-Client kann prüft, repariert, optimiert und analysiert Tabellen in MySQL-Datenbank.

To create a new cron job, login to the server as root or any other user, and then edit the crontab file (in most operating system, crontab -e will open crontab file in default text editor) to add in the following line of text. So erstellen Sie einen neuen Cron-Job, Login auf dem Server als root oder einem anderen Benutzer, und bearbeiten Sie dann die crontab-Datei (in den meisten Betriebssystemen, crontab-e crontab-Datei wird in der Standard-Text-Editor), um in der folgenden Zeile des Textes . For users using cPanel, click on “Cron job” where you can set up crontab at daily, hourly and other interval. Für Anwender, die cPanel, klicken Sie auf "cron-Job", wo können Sie crontab auf Tages-, Stunden-und anderen Intervall. Experience webmasters can also set up a crontab file in rc.hourly or rc.daily or other cron directory. Erleben Sie Webmaster können auch eine crontab-Datei in rc.hourly oder rc.daily oder andere Cron-Verzeichnis. Note that if you login as a MySQL or normal user with no access privileges to all database, it's not possible to optimize all databases, unless user ID and password for root is specified as in example below. Beachten Sie, dass, wenn Sie sich anmelden oder MySQL als normaler Benutzer keine Zugriffsrechte auf alle Datenbanken, ist es nicht möglich, alle Datenbanken zu optimieren, es sei denn, Benutzer-ID und das Passwort für root ist wie im Beispiel unten.

0 1 * * * mysqlcheck -Aao –auto-repair -u root -p[password] > /dev/null 0 1 * * * mysqlcheck-AAO-auto-Reparatur-u root-p [passwort]> / dev / null

The above statement has the syntax similar to “mysqlcheck [options] –all-databases”, where –all-databases parameter is the default action is no databases is specified thus can be omitted. Die oben genannten Erklärung hat die Syntax ähnlich wie bei "mysqlcheck [options]-all-databases", in dem all-databases-Parameter ist die Standard-Aktion ist keine Datenbanken ist damit kann weggelassen werden. The command will run mysqlcheck client to automatically analyze and optimize all databases at 1 am everyday. Der Befehl wird mysqlcheck-Client automatisch zu analysieren und optimieren alle Datenbanken auf 1 Uhr täglich. Note that there is not space between -p and your password for root. Beachten Sie, dass es keine Leerzeichen zwischen-p und Ihr Passwort für root. You can change the running time to your preference, and also change the options for mysqlcheck command. Sie können die Laufzeit nach Ihren Wünschen, und auch die Optionen für mysqlcheck Befehl. If you just want to check and optimize certain databases or certain tables without the database, use the following syntax: Wenn Sie nur wollen, zu überprüfen und optimieren bestimmte Datenbanken oder bestimmte Tabellen ohne die Datenbank, verwenden Sie die folgende Syntax:

mysqlcheck [options] db_name [tables] mysqlcheck [options] db_name [Tabellen]
mysqlcheck [options] –databases DB1 [DB2 DB3...] mysqlcheck [options]-Datenbanken DB1 [DB2 DB3 ...]

You may want to remove –auto-repair switch from the above command, as a table repair operation might cause data loss under some circumstances the operation due to causes include but are not limited to filesystem errors. Sie können remove-Auto-Reparatur-Schalter aus den oben genannten Befehl, wie eine Tabelle Reparatur könnte zu Datenverlust führen, unter bestimmten Umständen den Betrieb aufgrund der Ursachen sind aber nicht beschränkt auf Dateisystem-Fehler. For those who has changed the character set and collation of MySQL databases may also need to use –default-character-set option. Für diejenigen, die sich geändert hat den Zeichensatz und Sortierung von MySQL-Datenbanken müssen unter Umständen auch zu nutzen-default-character-set-Option. More information on all available switches and options available can be found Mehr Informationen über alle verfügbaren Schalter und die verfügbaren Optionen finden Sie here hier . .

IMPORTANT : The page is machine translated and provided "as is" without warranty. WICHTIG: Die Seite ist Maschine übersetzt und "as is" ohne Garantie. Machine translation may be difficult to understand. Maschinelle Übersetzung kann schwierig zu verstehen. Please refer to Bitte beachten Sie original English article Original Englisch Artikel whenever possible. wann immer dies möglich ist.


5 Responses to “Check and Optimize MySQL Database Automatically with Crontab/Cron” 5 Antworten zu "Prüfen und Optimieren von MySQL-Datenbank automatisch mit crontab / cron"

  1. Lowongan Kerja Lowongan Kerja
    April 2nd, 2009 09:41 2 Apr 2009 09:41
    5 5

    I'ma newby on managing MySQL. Ich bin ein Newby über den Umgang mit MySQL.
    I want to ask you, how to to make sure if the Cron is working? Ich möchte Sie fragen, wie man, um sicherzustellen, dass, wenn der Cron ist?

    Thanks Danke

  2. tbartels tbartels
    November 16th, 2008 12:48 16. Nov. 2008 12:48
    4 4

    along the lines of what Zubin is suggesting you can use the –silent(-s) switch as well, so you only get output if there is an error, something like entlang der Linien von dem, was Zubin schlägt können Sie den-silent (-s)-Schalter als auch, so dass Sie nur dann ausgegeben, wenn es ein Fehler, so etwas wie

    MAILTO=email@domain.com MAILTO = email@domain.com
    0 1 * * * mysqlcheck -Aaos -uroot -ppassword 0 1 * * * mysqlcheck-AAOS-uroot-ppassword

    this way you will only get an email if there is an error diese Weise werden Sie nur eine E-Mail erhalten, wenn es ein Fehler

  3. php-trivandrum php-Trivandrum
    September 20th, 2008 18:34 Der 20. September 2008 18:34
    3 3

    Sure mysql does need frequent tunning, and also I have seen a lot of the servers running in the default configuration. Sie sicher, MySQL braucht häufig tunning, und auch ich habe viel von den Servern, die in der Standard-Konfiguration. which happens to be a very modest one. was sich als sehr bescheiden. If you have access to the mysql configuration file, there are some values that can make your server breathe more often. Wenn Sie Zugang zu den MySQL-Konfigurations-Datei, gibt es einige Werte, die sich um Ihren Server atmen häufiger. And make your visitors more happy. Und machen Sie Ihren Besuchern mehr glücklich.

  4. Mike - Mike --
    May 6th, 2008 19:15 6. Mai 2008 19:15
    2 2

    I did not know that it was nesessary to perform a regular check for mysql. Ich wusste nicht, dass es nesessary, um eine regelmäßige Überprüfung auf MySQL.

  5. Zubin Zubin
    January 16th, 2008 06:40 16. Januar 2008 06:40
    1 1

    Note that -–auto-repair should have two dashes Beachten Sie, dass - Auto-Reparatur müssen zwei Bindestriche

    Also, you might want to leave “> /dev/null” out for the first few runs, to see the results of the command (if you put MAILTO=me@mydomain.com at the top of the crontab, the results will get sent there). Auch Sie könnten zu verlassen "> / dev / null" für die ersten paar Durchläufe, um zu sehen, die Ergebnisse des Befehls (wenn Sie MAILTO = me@mydomain.com an der Spitze der crontab, die Ergebnisse werden gesendet gibt).

Leave a Reply Lassen Sie eine Antwort

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 to comments feature has been disabled. Abonnieren Sie Kommentare Funktion wurde deaktiviert. To receive notification of latest comments posted, subscribe to Um Anmeldung der neuesten Kommentare abonnieren My Digital Life Comments RSS feed My Digital Life Kommentare RSS-Feed or oder register to receive Register zu erhalten new comments in daily email digest. neue Kommentare in der täglichen E-Mail-Benachrichtigung.
Custom Search

New Articles Neue Artikel

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

mysql optimize database MySQL Datenbank optimieren - -- optimize mysql database Optimierung von MySQL-Datenbank - -- mysql check database MySQL-Datenbank überprüfen - -- mysql optimize mysql optimieren - -- check mysql database MySQL-Datenbank überprüfen - -- optimize mysql Optimierung von MySQL - -- mysqlcheck optimize mysqlcheck optimieren - -- mysql check mysql prüfen - -- mysql database check MySQL-Datenbank überprüfen - -- mysql check db mysql überprüfen db - -- mysqlcheck cron mysqlcheck Cron - -- optimize database mysql Optimierung der Datenbank MySQL - -- mysql optimize table mysql Tabelle optimieren - -- check database mysql Check-Datenbank MySQL - -- crontab mysql crontab mysql - -- mysql crontab mysql crontab - -- how to optimize mysql database how zur Optimierung von MySQL-Datenbank - -- how to check mysql database wie Sie MySQL-Datenbank - -- mysql health check mysql Gesundheits-Check - -- mysql cron mysql cron - -- optimizing mysql database Optimierung von MySQL-Datenbank - -- mysql optimize cron mysql optimieren Cron - -- mysql db check MySQL-Datenbank überprüfen - -- optimize mysql db Optimierung von MySQL-Datenbank - -- mysql check databases MySQL-Datenbanken überprüfen - -- optimize mysql databases Optimierung von MySQL-Datenbanken - -- mysql optimize table cron mysql Tabelle optimieren Cron - -- mysql optimize tables MySQL-Tabellen zu optimieren - -- mysql table optimize mysql Tabelle optimieren - -- mysql auto optimize mysql automatisch optimieren - -- cron mysql cron mysql - -- check mysql db Check mysql db - -- mysql OPTIMIZE DB mysql DB OPTIMIZE - -- optimize tables mysql Optimierung von MySQL-Tabellen - -- optimize mysql tables Optimierung von MySQL-Tabellen - -- optimize mysql freebsd optimieren mysql freebsd - -- mysql optimize all databases MySQL-Optimierung aller Datenbanken - -- cron mysql optimize cron mysql optimieren - -- optimize database Optimierung der Datenbank - -- mysql optimize repair mysql optimieren Reparatur - -- mysql optimize command mysql optimieren Befehl - -- all alle - -- mysql cron optimize mysql cron optimieren - -- optimize mysql table Optimierung von MySQL-Tabelle - -- mysql database health MySQL-Datenbank Gesundheit - -- mysql database optimize MySQL-Datenbank optimieren - -- cron optimize mysql cron mysql optimieren - -- optimizing mysql tables Optimierung von MySQL-Tabellen - -- mysql check all databases mysql alle Datenbanken - -- mysql optimize database command Optimierung der Datenbank MySQL Befehl - -- mysql "check database" mysql "Datenbank überprüfen" - -- mysql repair cron mysql Reparatur Cron - -- mysql check optimize mysql überprüfen optimieren - -- mysqlcheck crontab mysqlcheck crontab - -- optimize mysql cron Optimierung von MySQL-cron - -- cron mysql query cron mysql Abfrage - -- mysql database check MySQL-Datenbank überprüfen - -- cronjob mysql Cronjob mysql - -- cron job optimize mysql Cron-Job zu optimieren mysql - -- mysql database health check MySQL-Datenbank-Gesundheits-Check - -- how to optimize a mysql database wie zur Optimierung einer MySQL-Datenbank - -- Mysql database checker MySQL-Datenbank-Checker - -- mysql automatically repair tables mysql automatisch der Reparatur von Tabellen - -- OPTIMIZE TABLE cron OPTIMIZE TABLE Cron - -- mysql command optimize database mysql Befehl Datenbank optimieren - -- cron job mysql optimize Cron-Job mysql optimieren - -- check mysql Check mysql - -- mysql optimize databases MySQL-Datenbanken optimieren - -- optimize table cronjob OPTIMIZE TABLE Cronjob - -- mysql dbcheck mysql dbcheck - -- automate mysql optimization automatisieren mysql Optimierung - -- update mysql with cron linux MySQL Update mit cron Linux - -- mysql optimize database cron MySQL Datenbank optimieren Cron - -- mysql cronjob mysql Cronjob - -- cron job to repair all databases Cron-Job für die Reparatur aller Datenbanken - --