Check and Optimize MySQL Database Automatically with Crontab/Cron Pārbaudiet un Optimizējiet MySQL Database Automātiski ar Crontab / Cron

MySQL is a very popular free yet powerful database system. MySQL ir ļoti populārs brīvā vēl jaudīgu datu bāzes sistēmu. 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. Bet pat ļoti datubāzēm, tabulās var kļūt sadrumstalots ar kontaktstrāvas dēļ nepārtraukti atjaunināt vai dzēst un ievietojiet darbībai uz datiem, kas uzglabāti datubāzē. Beside, it's also possibility that the databases may get corrupted. Blakus, ir arī iespēja, ka datubāzes var kļūt bojāti. Thus, performing health check on database and optimize MySQL server regularly is an important task. Tādējādi, veicot veselības pārbaudi par datu bāzi un pilnveidot MySQL servera regulāri ir svarīgs uzdevums.

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. Tas ir mazliet apgrūtinoša, ja datu bāzes administrators ir login ar serveri vai palaišanai ar phpMyAdmin, lai optimizētu datu bāzes, pa vienam vai galda ar tabulu manuāli. Sometimes DB admin may simply forgets to do the job or set the frequency of optimization to lesser times. Dažreiz BP admin var vienkārši aizmirst, lai veiktu darbu vai noteikt biežumu optimizācijas mazākā reizes. It's recommended that every tables in MySQL databases are checked at least once a day on a busy server. Tas ir ieteicams, ka katru tabulu MySQL datubāzes ir pārbaudīti vismaz vienu reizi dienā, ir aizņemta serveri.

It's possible to automate the optimization of MySQL process by using crontab function in Linux/Unix/CentOS/FreeBSD. Tas ir iespējams automatizēt optimizācijai MySQL process, izmantojot crontab funkciju Linux / Unix / CentOS / FreeBSD. The cron job to check and optimize MySQL databases can be created by using mysqlcheck client utility comes MySQL installation. Par Cron darbs, lai pārbaudītu un optimizēt MySQL datu bāzes var izveidot, izmantojot mysqlcheck klients lietderība nāk MySQL uzstādīšana. mysqlcheck client can checks, repairs, optimizes, and analyzes tables in MySQL database. mysqlcheck klients var pārbaudēm, remonts, pilnveido, un analizē tabulas MySQL datu bāzi.

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. Lai izveidotu jaunu Cron darbu, piesakieties uz servera, kā saknes vai jebkurš cits lietotājs, un pēc tam rediģēt crontab fails (vairumā operētājsistēmu, crontab-e atvērs crontab failu noklusējuma teksta redaktoru) ar ko pievieno šādos rindiņa . For users using cPanel, click on “Cron job” where you can set up crontab at daily, hourly and other interval. Lietotājiem, izmantojot cPanel, noklikšķiniet uz "Cron darbu", kur var izveidot crontab dienas, stundas un citas intervālu. Experience webmasters can also set up a crontab file in rc.hourly or rc.daily or other cron directory. Pieredze Tīmekļa pārziņi var izveidot crontab failu rc.hourly vai rc.daily vai citu Cron direktorijā. 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. Ievērojiet, ka, ja jūs piesakieties kā MySQL vai parastu lietotāju ar nekādas piekļuves privilēģijas uz visām datu bāzē, tas nav iespējams, lai optimizētu visu datu bāzes, ja vien lietotāja ID un paroli sakne tiek precizēta kā piemērā turpmāk.

0 1 * * * mysqlcheck -Aao –auto-repair -u root -p[password] > /dev/null 0 1 * * * mysqlcheck-Aao-auto-remonts-u root-p [parole]> / 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. Iepriekš minētais paziņojums ir sintakse līdzīga "mysqlcheck [iespējas]-all-datubāzēm", kur-all-datubāzēs parametrs ir noklusējuma darbība nav datubāzēs ir norādīts tādējādi to var izlaist. The command will run mysqlcheck client to automatically analyze and optimize all databases at 1 am everyday. Komandiera darbosies mysqlcheck klients automātiski analizējam un optimizēt visu datubāzēs 1 am ikdienas. Note that there is not space between -p and your password for root. Atcerieties, ka tur nav atstarpe starp-p un jūsu paroli root. You can change the running time to your preference, and also change the options for mysqlcheck command. Jūs varat mainīt darba laika, lai savu izvēli, kā arī mainīt iespējas mysqlcheck komandu. If you just want to check and optimize certain databases or certain tables without the database, use the following syntax: Ja jūs vienkārši vēlaties pārbaudīt un optimizēt dažu datubāzu, vai dažas tabulas bez datu bāzē, izmanto šādu sintaksi:

mysqlcheck [options] db_name [tables] mysqlcheck [iespējas] db_name [tabulas]
mysqlcheck [options] –databases DB1 [DB2 DB3...] mysqlcheck [iespējas]-datubāzēs 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. Varat izņemt-auto-remonts pāriet no iepriekš komanda, kā galda remonta darbība var radīt datu zudumiem, kas atsevišķos gadījumos darbības dēļ ietver, bet neaprobežojas ar filesystem kļūdas. For those who has changed the character set and collation of MySQL databases may also need to use –default-character-set option. Tiem, kas ir mainījies rakstzīmju kopas un apkopošana MySQL datubāzēm var būt nepieciešama, lai izmantotu-default rakstzīmju komplekta izvēle. More information on all available switches and options available can be found Plašāka informācija par visiem pieejamajiem slēdži un iespējām var atrast here šeit . .

IMPORTANT : The page is machine translated and provided "as is" without warranty. SVARĪGI: Šī lapa ir mašīna tulkoto un ar nosacījumu ", kas ir" bez garantijas. Machine translation may be difficult to understand. Machine translation var būt grūti saprast. Please refer to Lūdzu, skatiet original English article oriģināls angļu rakstu whenever possible. kad vien iespējams.


5 Responses to “Check and Optimize MySQL Database Automatically with Crontab/Cron” 5 Atbildes uz "Check un Optimizējiet MySQL Database Automātiski ar Crontab / Cron"

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

    I'ma newby on managing MySQL. Esmu newby pārvaldības MySQL.
    I want to ask you, how to to make sure if the Cron is working? Es gribētu lūgt jūs, par to, kā pārliecināties, ja Cron darbojas?

    Thanks Pateicība

  2. tbartels tbartels
    November 16th, 2008 12:48 Novembris 16, 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 gar līniju par to, kas Zubin ierosina varat izmantot-klusa (-s) slēdzi, kā arī, lai jūs tikai iegūt izejas, ja ir kļūda, kaut ko līdzīgu

    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 Šādā veidā jūs tikai saņemt e-pastu, ja ir kļūda

  3. php-trivandrum php-trivandrum
    September 20th, 2008 18:34 Septembris 20, 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. Sure mysql nav vajadzīga bieža tunning, kā arī esmu redzējis daudz serveru braukšanu noklusējuma konfigurācijai. which happens to be a very modest one. kas notiek, ir ļoti pieticīgs vienu. If you have access to the mysql configuration file, there are some values that can make your server breathe more often. Ja jums ir piekļuve ar mysql konfigurācijas failu, ir dažas vērtības, kas var dot savu serveri elpot biežāk. And make your visitors more happy. Un, lai jūsu apmeklētāji vairāk laimīgs.

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

    I did not know that it was nesessary to perform a regular check for mysql. Es nezināju, ka bija nesessary veikt regulāri pārbaudītu, mysql.

  5. Zubin Zubin
    January 16th, 2008 06:40 Janvāris 16, 2008 06:40
    1 1

    Note that -–auto-repair should have two dashes Jāņem vērā, ka - auto remonta jābūt diviem domuzīmes

    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). Tāpat, ja jūs vēlaties atvaļinājuma "> / dev / null", kas paredzēti dažu pirmo sēriju, lai redzētu rezultātus, kā komanda (ja jūs likts mailto = me@mydomain.com augšpusē no crontab, rezultāti kļūs nosūtīja pastāv).

Leave a Reply Atstāj atbildi

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> Jūs varat izmantot šos tagus: <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. Parakstīties uz komentāriem iezīme ir atspējota. To receive notification of latest comments posted, subscribe to Lai saņemtu paziņojumu par jaunāko komentāri norīkots darbā, abonēt My Digital Life Comments RSS feed Mani Digital Life Comments RSS feed or vai register to receive reģistrēties, lai saņemtu new comments in daily email digest. jauni komentāri ikdienas e-pasta sagremot.
Custom Search

New Articles Jauns pants

Incoming Search Terms for the Article Incoming Meklēt Noteikumi par pants

mysql optimize database mysql optimizēt datu bāze - -- optimize mysql database optimizējiet mysql datubāzē - -- mysql check database mysql pārbaudīt datu bāzē - -- mysql optimize mysql optimizējiet - -- check mysql database pārbaudīt mysql datubāzē - -- optimize mysql optimizējiet mysql - -- mysqlcheck optimize mysqlcheck optimizējiet - -- mysql check mysql pārbaudīt - -- mysql database check mysql datu bāzi, pārbaudīt - -- mysql check db mysql pārbaudīt db - -- mysqlcheck cron mysqlcheck Cron - -- optimize database mysql optimizēt datu bāzē mysql - -- mysql optimize table mysql optimizējiet galda - -- check database mysql pārbaudīt datu bāzē mysql - -- crontab mysql crontab mysql - -- mysql crontab mysql crontab - -- how to optimize mysql database kā optimizēt mysql datubāzē - -- how to check mysql database kā pārbaudīt mysql datubāzē - -- mysql health check mysql veselības pārbaude - -- mysql cron mysql Cron - -- optimizing mysql database optimizēt mysql datubāzē - -- mysql optimize cron mysql optimizējiet Cron - -- mysql db check mysql db pārbaudīt - -- optimize mysql db optimizējiet mysql db - -- mysql check databases mysql pārbaudīt datu bāzes - -- optimize mysql databases optimizējiet mysql datu bāzes - -- mysql optimize table cron mysql optimizējiet galda Cron - -- mysql optimize tables mysql optimizēt tabulas - -- mysql table optimize mysql tabula optimizējiet - -- mysql auto optimize mysql auto optimizējiet - -- cron mysql Cron mysql - -- check mysql db pārbaudīt mysql db - -- mysql OPTIMIZE DB mysql Optimizējiet BP - -- optimize tables mysql optimizēt tabulas mysql - -- optimize mysql tables optimizējiet mysql tabulas - -- optimize mysql freebsd optimizējiet mysql FreeBSD - -- mysql optimize all databases mysql optimizēt visu datu bāzes - -- cron mysql optimize Cron mysql optimizējiet - -- optimize database optimizēt datu bāze - -- mysql optimize repair mysql optimizējiet remonts - -- mysql optimize command mysql optimizējiet komanda - -- all viss - -- mysql cron optimize mysql Cron optimizējiet - -- optimize mysql table optimizējiet mysql tabula - -- mysql database health mysql datu bāzi, veselības - -- mysql database optimize mysql datubāzē optimizējiet - -- cron optimize mysql Cron optimizējiet mysql - -- optimizing mysql tables optimizēt mysql tabulas - -- mysql check all databases mysql pārbauda visas datu bāzes - -- mysql optimize database command mysql optimizēt datu bāzes komanda - -- mysql "check database" mysql "Check datu bāze" - -- mysql repair cron mysql remonts Cron - -- mysql check optimize mysql pārbaudīt optimizējiet - -- mysqlcheck crontab mysqlcheck crontab - -- optimize mysql cron optimizējiet mysql Cron - -- cron mysql query Cron mysql query - -- mysql database check mysql datu bāzi, pārbaudīt - -- cronjob mysql cronjob mysql - -- cron job optimize mysql Cron darba optimizējiet mysql - -- mysql database health check mysql datubāzē veselības pārbaude - -- how to optimize a mysql database kā optimizēt a mysql datubāzē - -- Mysql database checker Mysql datubāzē pārbaudītājs - -- mysql automatically repair tables mysql automātiski remonts tabulas - -- OPTIMIZE TABLE cron Optimizējiet TABLE Cron - -- mysql command optimize database mysql komandu optimizēt datu bāze - -- cron job mysql optimize Cron darba mysql optimizējiet - -- check mysql pārbaudīt mysql - -- mysql optimize databases mysql optimizēt datu bāzes - -- optimize table cronjob optimizējiet galda cronjob - -- mysql dbcheck mysql dbcheck - -- automate mysql optimization automatizēt mysql optimizācija - -- update mysql with cron linux update mysql ar Cron Linux - -- mysql optimize database cron mysql optimizēt datu bāzē Cron - -- mysql cronjob mysql cronjob - -- cron job to repair all databases Cron darbu remontēt visas datu bāzes - --