Jul 24, 2018 by Robert Gravelle Show A database event is a task that runs according to a schedule. Also known as "scheduled events", an event is similar to a cron job in UNIX or a task scheduler task in Windows, except that scheduled events are configured using a database's syntax and/or command-line-interface (CLI). Database events have many uses, such as optimizing database tables, cleaning up logs, archiving data, or generating complex reports during off-peak time. In previous blogs on this topic, we learned how to configure events using MySQL as our database. Today, we're going to schedule a database task using the Navicat Premium GUI Database Management Tool. In Navicat database management offerings, including Navicat Premium, the Event Designer is the tool for working with events. It's accessible by clicking on the Event button on the main toolbar: Clicking the Event button opens the Event object list in the Object pane. The Object pane toolbar contains three buttons: Design Event, New Event, and Delete Event. If you have no events defined, only the New Event button will be enabled. Creating a New EventClick the New Event button to open a new untitled Definition tab: You can enter any valid SQL procedure statement in the Definition tab. This can be a simple statement such as "INSERT INTO tbl_users (first_name,last_name) VALUES('Bob','Jones');", or it can be a compound statement written within BEGIN and END statement delimiters. Compound statements can contain declarations, loops, and other control structure statements. Note that we don't have to write the CREATE EVENT code, as this is handled by Navicat (as we'll see in the following sections). Here is an event definition that inserts a new row in the sakila.actor table: Scheduling your EventNavicat alleviates much of the burden of scheduling events by providing a form for entering scheduling details. The scheduling form is located on the Schedule tab. It supports the adding of Intervals that may comprise either simple or complex time units. Here's a simple example that sets the event to execute 5 minutes after creation: Here's a more complex event schedule that starts in 5 minutes, and runs every five-and-a-half hours for 3 days: Saving an EventTo save an Event, click the Save button on the Even tab. If you like, you can preview the generated SQL on the SQL Preview tab before saving it: Note that the statement is read-only and cannot be edited in the preview. Adding CommentsYou can include comments with your Event on the Comment tab. It adds them to the CREATE EVENT statement via the COMMENT clause: Deleting an EventTo delete an Event, select it in the Object tab and click the Delete Event button. A warning dialog will ask you to confirm that you wish to delete the Event: Modifying an EventTo modify an Event, select it in the Object tab and click the Design Event button. That will open it in the Event tab. Monitoring MySQL Server pada Zabbix - Pada kesempatan kali ini, www.dimasrio.com akan menjelaskan bagimana cara melakukan
monitoring mysql server pada zabbix. Bagi anda yang belum mengetahui apa itu zabbix, silahkan mebaca artikel berikut : Oke sobat, disini saya anggap anda sudah menginstall Zabbix Server, Zabbix Agent dan MariaDB (mysql) di server CentOS anda. Langkah pertama buka direktori /etc/zabbix/zabbix_agentd.conf kemudian edit
menu include seperti dibawah ini. Buat direktori /var/lib/zabbix sebagai default informasi untuk zabbix mengakses mysql. Selanjutnya buat file .my.cnf . dan tambahkan script dibawah ini. [mysql] Buat user zabbix_boy pada mysql. MariaDB [(none)]>create user 'zabbix_boy'@'localhost' identified by 'password'; Setelah selesai restart zabbix-agent. systemctl restart zabbix-agent Sampai disini konfigurasi mysql pada zabbix server sudah selesai. Sekarang anda sudah bisa menggunakan tempalte app mysql pada zabbix. |