Check and Optimize MySQL Database Automatically with Crontab/Cron Controllare e ottimizzare i database MySQL automaticamente con crontab / cron

MySQL is a very popular free yet powerful database system. MySQL è un libero molto popolare ancora potente sistema di basi di dati. 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. Ma anche in grandi basi di dati, le tabelle possono ottenere con lavagna frammentato a causa di continuo aggiornamento, eliminare o inserire funzionamento e sui dati memorizzati nel database. Beside, it’s also possibility that the databases may get corrupted. Accanto, è anche possibile che il database può ottenere danneggiato. Thus, performing health check on database and optimize MySQL server regularly is an important task. Quindi, eseguire controllo sanitario su base di dati e ottimizzare regolarmente server MySQL è un compito importante.

It’sa 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. È un po 'fastidioso se il database per gli amministratori hanno accesso al server o il lancio di phpMyAdmin per ottimizzare le basi di dati uno dopo l'altro o da tavolo tabella manualmente. Sometimes DB admin may simply forgets to do the job or set the frequency of optimization to lesser times. Talvolta PB amministratore può semplicemente dimentica di fare il proprio lavoro o per impostare la frequenza di ottimizzazione a volte minore. It’s recommended that every tables in MySQL databases are checked at least once a day on a busy server. E 'raccomandato che tutti i tavoli in basi di dati di MySQL sono controllati almeno una volta al giorno su un server occupato.

It’s possible to automate the optimization of MySQL process by using crontab function in Linux/Unix/CentOS/FreeBSD. E 'possibile automatizzare l'ottimizzazione del processo di MySQL tramite crontab in funzione di Linux / Unix / CentOS / FreeBSD. The cron job to check and optimize MySQL databases can be created by using mysqlcheck client utility comes MySQL installation. Il job di cron per controllare e ottimizzare le basi di dati di MySQL può essere creato utilizzando mysqlcheck cliente viene utilità di installazione di MySQL. mysqlcheck client can checks, repairs, optimizes, and analyzes tables in MySQL database. mysqlcheck client è in grado di controlli, riparazioni, ottimizza, e analizza le tabelle di cui al database MySQL.

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. Per creare un nuovo job in cron, effettua il login al server come utente root o di qualsiasi altro utente, e quindi modificare il file crontab (nella maggior parte dei sistemi operativi, crontab-e si aprirà nel file crontab di default editor di testo) per aggiungere nella seguente riga di testo . For users using cPanel, click on “Cron job” where you can set up crontab at daily, hourly and other interval. Per gli utenti che utilizzano cPanel, fai clic su "cron job" dove è possibile impostare fino a crontab ogni giorno, orari e altre intervallo. Experience webmasters can also set up a crontab file in rc.hourly or rc.daily or other cron directory. L'esperienza webmaster possono anche creare un file crontab in rc.hourly o rc.daily o di altre directory di cron. 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. Si noti che se il login come MySQL o utente normale, senza privilegi di accesso a tutti i database, non è possibile ottimizzare tutti i database, a meno che l'ID utente e la password per l'utente root è specificato come nel seguente esempio.

0 1 * * * mysqlcheck -Aao –auto-repair -u root -p[password] > /dev/null 0 1 * * * mysqlcheck-Aao-auto-riparazione-u root-p [password]> / 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. La dichiarazione di cui sopra ha la sintassi simile a "mysqlcheck [opzioni]-tutte-le banche dati", dove-tutto-basi di dati parametro è l'azione predefinita è basi di dati non è specificato quindi può essere omessa. The command will run mysqlcheck client to automatically analyze and optimize all databases at 1 am everyday. Il comando verrà eseguito mysqlcheck cliente automaticamente analizzare e ottimizzare tutti i database a 1 sono tutti i giorni. Note that there is not space between -p and your password for root. Si noti che non vi è spazio tra-p e la tua password di root. You can change the running time to your preference, and also change the options for mysqlcheck command. È possibile modificare il tempo a proprio piacimento, e anche modificare le opzioni per mysqlcheck comando. If you just want to check and optimize certain databases or certain tables without the database, use the following syntax: Se si desidera solo per controllare e ottimizzare alcune basi di dati o di alcuni tavoli senza la base di dati, utilizzare la seguente sintassi:

mysqlcheck [options] db_name [tables] mysqlcheck [opzioni] db_name [tabelle]
mysqlcheck [options] –databases DB1 [DB2 DB3...] mysqlcheck [opzioni]-database 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. Potreste voler rimuovere-auto-riparazione passare da sopra il comando, come un tavolo di riparazione operazione potrebbe causare la perdita di dati in alcune circostanze l'operazione a causa di cause includono ma non sono limitati a filesystem di errori. For those who has changed the character set and collation of MySQL databases may also need to use –default-character-set option. Per chi ha cambiato il set di caratteri e la collation del database MySQL può inoltre bisogno di usare di default caratteri-set opzione. More information on all available switches and options available can be found Maggiori informazioni su tutte le opzioni disponibili e le opzioni disponibili può essere trovato here qui .

IMPORTANT : This is a machine translated page which is provided "as is" without warranty. IMPORTANTE: Questa è una macchina tradotto pagina che è fornito "così come sono" senza garanzia. Machine translation may be difficult to understand. La traduzione automatica può essere difficile da capire. Please refer to Si prega di fare riferimento a original English article articolo originale in inglese whenever possible. ogniqualvolta ciò sia possibile.

Share and contribute or get technical support and help at Condividere e contribuire o ottenere supporto tecnico e contribuire a My Digital Life Forums La mia vita digitale forum .



3 Responses to “Check and Optimize MySQL Database Automatically with Crontab/Cron” 3 Responses to "Controllare e ottimizzare automaticamente Database MySQL con crontab / cron"

  1. Zubin
    January 16th, 2008 06:40 16 gennaio 2008 06:40
    1

    Note that -–auto-repair should have two dashes Si noti che - auto-riparazione deve avere due trattini

    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). Inoltre, si potrebbe desiderare di lasciare "> / dev / null" per le prime corse, per vedere i risultati del comando (se metti MAILTO = me@mydomain.com nella parte superiore della crontab, i risultati avranno ci ha inviato).

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

    I did not know that it was nesessary to perform a regular check for mysql. Non sapevo che era nesessary per eseguire un controllo regolare per mysql.

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

    Sure mysql does need frequent tunning, and also I have seen a lot of the servers running in the default configuration. Certo non mysql necessità Tunning frequenti, e inoltre ho visto un sacco di server in esecuzione in configurazione di default. which happens to be a very modest one. che succede ad essere molto modesto. If you have access to the mysql configuration file, there are some values that can make your server breathe more often. Se si ha accesso al file di configurazione di MySQL, ci sono alcuni valori che possono rendere il vostro server di respirare più spesso. And make your visitors more happy. E fare i tuoi visitatori più felice.

Leave a Reply Lascia un Commento

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> È possibile utilizzare questi tag: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime = ""> <em> <i> <q Cite=""> <strike> <strong>

Subscribe without commenting Iscriviti senza commentare


Custom Search

New Articles Nuovi articoli

Incoming Search Terms for the Article Cerca in entrata Termini per l'articolo

mysql check database controllo del database mysql - -- optimize mysql database ottimizzare database mysql - -- check mysql database verificare database mysql - -- mysql database check database mysql verificare - -- check database mysql controllo del database mysql - -- mysql check db verificare db mysql - -- mysqlcheck optimize mysqlcheck ottimizzare - -- mysql optimize database ottimizzare database mysql - -- optimize database ottimizzare la banca dati - -- mysql optimize all databases mysql ottimizzare tutti i database - -- optimize mysql table ottimizzare MySQL Table - -- how to optimize mysql database come ottimizzare database mysql - -- mysql optimize command mysql ottimizzare comando - -- mysql optimize ottimizzare mysql - -- mysql auto repair mysql riparazione auto - -- mysql check mysql verificare - -- mysql check tables controllare le tabelle mysql - -- optimize mysql db ottimizzare db mysql - -- mysqlcheck cron mysqlcheck cron - -- mysql cron mysql cron - -- crontab mysql crontab mysql - -- how to check mysql database Come controllare database mysql - -- mysql check table mysql verificare tabella - -- optimize mysql ottimizzare mysql - -- optimize database mysql ottimizzare database mysql - -- cron mysql cron mysql - -- check mysql db verificare db mysql - -- mysql optimize repair mysql ottimizzare la riparazione - -- wordpress mysql optimize wordpress ottimizzare mysql - -- mysql db check db mysql verificare - -- check mysql table verificare MySQL Table - -- cron checker cron checker - -- mysql optimize cron mysql ottimizzare cron - -- Optimize MySQL Cron Ottimizzare mysql cron - -- MySQL optimize db Ottimizzare db MySQL - -- mysql health check mysql controllo sanitario - -- optimize mysql wordpress ottimizzare mysql wordpress - -- optimize mysql tables ottimizzare le tabelle mysql - -- mysql repair database la riparazione del database mysql - -- optimizing mysql database ottimizzare il database mysql - -- mysql table optimize MySQL Table ottimizzare - -- check table mysql verificare la tabella mysql - -- check mysql verificare mysql - -- mysqlcheck database mysqlcheck banca dati - -- mysql crontab mysql crontab - -- optimize mysql server ottimizzare server MySQL - -- repair mysql db riparazione db mysql - -- mysql check databases verificare database mysql - -- mysql autorepair mysql autorepair - -- cron mysqlcheck cron mysqlcheck - --