Check and Optimize MySQL Database Automatically with Crontab/Cron Memeriksa dan Optimalkan MySQL Database secara otomatis dengan crontab / Cron

MySQL is a very popular free yet powerful database system. MySQL sangat populer gratis namun handal database sistem. 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. Tetapi bahkan dalam database besar, yang mendapatkan meja Mei-bagi dengan overhead karena terus memperbarui, atau menghapus dan memasukkan operasi pada data yang tersimpan pada database. Beside, it's also possibility that the databases may get corrupted. Disamping, itu juga kemungkinan bahwa database juga bisa rusak. Thus, performing health check on database and optimize MySQL server regularly is an important task. Oleh karena itu, melakukan pemeriksaan kesehatan di database dan mengoptimalkan MySQL server secara berkala merupakan tugas penting.

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. It's a bit repot jika ada database administrator untuk login ke server atau meluncurkan phpMyAdmin untuk mengoptimalkan database satu per satu atau meja oleh tabel secara manual. Sometimes DB admin may simply forgets to do the job or set the frequency of optimization to lesser times. Kadang-kadang DB admin dapat dengan mudah lupa untuk melakukan pekerjaan atau mengatur frekuensi optimasi ke kurang kali. It's recommended that every tables in MySQL databases are checked at least once a day on a busy server. Ini direkomendasikan bahwa setiap tabel pada database MySQL telah dicentang setidaknya satu kali dalam sehari pada sibuk server.

It's possible to automate the optimization of MySQL process by using crontab function in Linux/Unix/CentOS/FreeBSD. Ini mungkin untuk secara otomatis proses optimasi dari MySQL dengan menggunakan crontab fungsi 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. Pekerjaan yang cron untuk memeriksa dan mengoptimalkan MySQL database dapat dibuat dengan menggunakan utilitas klien mysqlcheck datang MySQL instalasi. mysqlcheck client can checks, repairs, optimizes, and analyzes tables in MySQL database. mysqlcheck klien dapat memeriksa, perbaikan, optimal, dan menganalisa tabel pada 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. Untuk membuat cron pekerjaan baru, login ke server sebagai root atau pengguna lainnya, dan kemudian mengedit crontab file (dalam banyak sistem operasi, crontab-e crontab akan terbuka file dalam editor teks default) untuk menambahkan baris berikut dalam teks . For users using cPanel, click on “Cron job” where you can set up crontab at daily, hourly and other interval. Untuk pengguna yang menggunakan cPanel, klik "Cron pekerjaan" di mana Anda dapat mengatur crontab di harian, jam dan lainnya Interval. Experience webmasters can also set up a crontab file in rc.hourly or rc.daily or other cron directory. Pengalaman webmaster juga dapat membuat file dalam rc.hourly crontab atau cron rc.daily atau direktori. 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. Catatan bahwa jika Anda login sebagai user biasa atau MySQL tanpa hak akses ke semua database, maka tidak mungkin untuk mengoptimalkan semua database, kecuali user ID dan password untuk root yang ditentukan seperti pada contoh di bawah ini.

0 1 * * * mysqlcheck -Aao –auto-repair -u root -p[password] > /dev/null 0 1 * * * mysqlcheck-Aao-auto-perbaikan-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. Pernyataan di atas memiliki sintaks mirip dengan "mysqlcheck [pilihan]-all-database", di mana-semua-parameter database adalah tindakan standar ada database yang ditentukan sehingga dapat diabaikan. The command will run mysqlcheck client to automatically analyze and optimize all databases at 1 am everyday. Akan menjalankan perintah mysqlcheck ke klien secara otomatis menganalisis dan mengoptimalkan semua database di 1 sehari-hari. Note that there is not space between -p and your password for root. Perlu diketahui bahwa tidak ada spasi antara-p dan password untuk root. You can change the running time to your preference, and also change the options for mysqlcheck command. Anda dapat mengubah waktu berjalan ke preferensi Anda, dan juga mengubah pilihan mysqlcheck perintah. If you just want to check and optimize certain databases or certain tables without the database, use the following syntax: Jika Anda hanya ingin memeriksa dan mengoptimalkan tertentu database atau tabel tertentu tanpa database, gunakan sintaks berikut:

mysqlcheck [options] db_name [tables] mysqlcheck [options] db_name [tables]
mysqlcheck [options] –databases DB1 [DB2 DB3...] mysqlcheck [pilihan]-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. Anda mungkin ingin menghapus-auto-perbaikan beralih dari perintah di atas, seperti meja operasi perbaikan dapat menyebabkan hilangnya data di bawah beberapa keadaan yang menyebabkan operasi karena termasuk tetapi tidak terbatas pada filesystem kesalahan. For those who has changed the character set and collation of MySQL databases may also need to use –default-character-set option. Bagi mereka yang telah berubah karakter menetapkan dan pemeriksaan dari MySQL database juga harus menggunakan karakter-default-menetapkan pilihan. More information on all available switches and options available can be found Informasi lebih lanjut tentang semua tersedia aktif dan pilihan yang tersedia dapat ditemukan here di sini . .

IMPORTANT : The page is machine translated and provided "as is" without warranty. PENTING: Halaman yang diterjemahkan mesin dan diberikan "sebagaimana adanya" tanpa jaminan. Machine translation may be difficult to understand. Mesin terjemahan mungkin sulit dimengerti. Please refer to Silakan merujuk ke original English article artikel asli Inggris whenever possible. bila memungkinkan.


5 Responses to “Check and Optimize MySQL Database Automatically with Crontab/Cron” 5 Responses to "Periksa dan Optimasi MySQL Database secara otomatis dengan 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. I'ma newby pada mengatur MySQL.
    I want to ask you, how to to make sure if the Cron is working? Saya ingin bertanya, bagaimana cara untuk memastikan apakah Cron bekerja?

    Thanks Terima kasih

  2. tbartels tbartels
    November 16th, 2008 12:48 November 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 sepanjang baris apa Zubin adalah menyarankan anda dapat menggunakan-diam (s) beralih juga, sehingga Anda hanya mendapatkan output jika ada kesalahan, seperti

    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 Dengan cara ini Anda hanya akan mendapatkan email jika ada kesalahan

  3. php-trivandrum php-trivandrum
    September 20th, 2008 18:34 September 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. Yakin mysql tidak perlu sering tunning, dan saya juga melihat banyak server berjalan di konfigurasi default. which happens to be a very modest one. yang terjadi menjadi sangat sederhana satu. If you have access to the mysql configuration file, there are some values that can make your server breathe more often. Jika Anda memiliki akses ke file konfigurasi mysql, ada beberapa nilai-nilai yang dapat membuat server Anda lebih sering bernafas. And make your visitors more happy. Dan membuat pengunjung lebih senang.

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

    I did not know that it was nesessary to perform a regular check for mysql. I didn't know that it was nesessary untuk melakukan rutin memeriksa mysql.

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

    Note that -–auto-repair should have two dashes Perlu diketahui bahwa - auto-perbaikan harus memiliki dua strip

    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). Anda juga mungkin ingin meninggalkan "> / dev / null" untuk menjalankan beberapa pertama, untuk melihat hasil perintah (jika anda menaruh mailto = me@mydomain.com di bagian atas crontab, hasil akan mendapatkan dikirim ada).

Leave a Reply Meninggalkan Balas

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> Anda dapat menggunakan tag ini: <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. Berlangganan ke fitur komentar telah dinonaktifkan. To receive notification of latest comments posted, subscribe to Untuk menerima pemberitahuan komentar diposting terbaru, berlangganan My Digital Life Comments RSS feed Saya Digital Life Komentar RSS feed or atau register to receive mendaftar untuk menerima new comments in daily email digest. komentar baru di email harian digest.
Custom Search

New Articles Artikel Baru

Incoming Search Terms for the Article Cari Syarat masuk untuk Artikel

mysql optimize database mengoptimalkan database mysql - -- optimize mysql database mengoptimalkan mysql database - -- mysql check database memeriksa database mysql - -- mysql optimize mysql mengoptimalkan - -- check mysql database memeriksa database mysql - -- optimize mysql mengoptimalkan mysql - -- mysqlcheck optimize mysqlcheck mengoptimalkan - -- mysql check mysql memeriksa - -- mysql database check mysql database memeriksa - -- mysql check db mysql db memeriksa - -- mysqlcheck cron mysqlcheck cron - -- optimize database mysql mengoptimalkan database mysql - -- mysql optimize table mengoptimalkan tabel mysql - -- check database mysql memeriksa database mysql - -- crontab mysql crontab mysql - -- mysql crontab mysql crontab - -- how to optimize mysql database bagaimana mengoptimalkan mysql database - -- how to check mysql database bagaimana untuk memeriksa database mysql - -- mysql health check mysql cek kesehatan - -- mysql cron mysql cron - -- optimizing mysql database mengoptimalkan mysql database - -- mysql optimize cron mysql mengoptimalkan cron - -- mysql db check mysql db memeriksa - -- optimize mysql db mengoptimalkan mysql db - -- mysql check databases memeriksa database mysql - -- optimize mysql databases mengoptimalkan mysql database - -- mysql optimize table cron mengoptimalkan mysql tabel cron - -- mysql optimize tables mengoptimalkan tabel mysql - -- mysql table optimize mysql tabel mengoptimalkan - -- mysql auto optimize mysql otomatis mengoptimasi - -- cron mysql cron mysql - -- check mysql db memeriksa mysql db - -- mysql OPTIMIZE DB mysql MENGOPTIMASI DB - -- optimize tables mysql mengoptimalkan tabel mysql - -- optimize mysql tables mengoptimalkan tabel mysql - -- optimize mysql freebsd mengoptimalkan mysql freebsd - -- mysql optimize all databases mysql mengoptimalkan semua database - -- cron mysql optimize cron mysql mengoptimalkan - -- optimize database mengoptimalkan database - -- mysql optimize repair mysql mengoptimalkan perbaikan - -- mysql optimize command mysql mengoptimalkan perintah - -- all semua - -- mysql cron optimize mysql cron mengoptimalkan - -- optimize mysql table mengoptimalkan tabel mysql - -- mysql database health mysql database kesehatan - -- mysql database optimize mengoptimalkan database mysql - -- cron optimize mysql cron mengoptimalkan mysql - -- optimizing mysql tables mengoptimalkan tabel mysql - -- mysql check all databases memeriksa semua database mysql - -- mysql optimize database command mengoptimalkan database mysql perintah - -- mysql "check database" mysql "memeriksa database" - -- mysql repair cron mysql perbaikan cron - -- mysql check optimize mysql memeriksa mengoptimalkan - -- mysqlcheck crontab mysqlcheck crontab - -- optimize mysql cron mengoptimalkan mysql cron - -- cron mysql query cron mysql query - -- mysql database check mysql database memeriksa - -- cronjob mysql cronjob mysql - -- cron job optimize mysql cron pekerjaan mengoptimalkan mysql - -- mysql database health check mysql database memeriksa kesehatan - -- how to optimize a mysql database bagaimana mengoptimalkan sebuah mysql database - -- Mysql database checker Mysql database pemeriksa - -- mysql automatically repair tables mysql secara otomatis memperbaiki tabel - -- OPTIMIZE TABLE cron MENGOPTIMASI TABEL cron - -- mysql command optimize database mysql perintah mengoptimalkan database - -- cron job mysql optimize cron pekerjaan mysql mengoptimalkan - -- check mysql memeriksa mysql - -- mysql optimize databases mengoptimalkan database mysql - -- optimize table cronjob mengoptimalkan tabel cronjob - -- mysql dbcheck mysql dbcheck - -- automate mysql optimization otomatis mysql optimasi - -- update mysql with cron linux update mysql dengan cron linux - -- mysql optimize database cron mengoptimalkan database mysql cron - -- mysql cronjob mysql cronjob - -- cron job to repair all databases cron pekerjaan untuk memperbaiki semua database - --