{"id":1862,"date":"2019-10-03T15:55:35","date_gmt":"2019-10-03T07:55:35","guid":{"rendered":"https:\/\/www.mondoze.com\/guide\/?post_type=kb&#038;p=1862"},"modified":"2022-10-07T07:51:33","modified_gmt":"2022-10-06T23:51:33","slug":"mysql-trigger-and-view","status":"publish","type":"kb","link":"https:\/\/www.mondoze.com\/guide\/kb\/mysql-trigger-and-view","title":{"rendered":"MySQL Trigger and View"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"1862\" class=\"elementor elementor-1862\" data-elementor-settings=\"[]\">\n\t\t\t\t\t\t<div class=\"elementor-inner\">\n\t\t\t\t\t\t\t<div class=\"elementor-section-wrap\">\n\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-58011ddc elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"58011ddc\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t\t\t<div class=\"elementor-row\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-3398e98f\" data-id=\"3398e98f\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-column-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<div class=\"elementor-widget-wrap\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-a54d5c2 elementor-widget elementor-widget-heading\" data-id=\"a54d5c2\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">What is MySQL Trigger and View<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-30cadbb1 elementor-widget elementor-widget-text-editor\" data-id=\"30cadbb1\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-text-editor elementor-clearfix\">\n\t\t\t\t<h4 dir=\"ltr\"><strong><u><i>Trigger<\/i><\/u><\/strong><\/h4><p dir=\"ltr\">The MySQL trigger is a database object that is associated with a table. It will be activated when a defined action is executed for the table. The trigger can be executed when you run one of the following MySQL statements on the table: INSERT, UPDATE and DELETE. It can be invoked before or after the event which means it can be schedule to run at certain time.<\/p><h4 dir=\"ltr\"><u><i><strong>View<\/strong><\/i><\/u><\/h4><p dir=\"ltr\">A view works like a table, but it is not a table. It never exists; it is only a prepared SQL statement that is run when you reference the view name.<\/p><p>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<\/p><p dir=\"ltr\">MySQL creates a temporary table based on the view definition statement and then executes the incoming query on this temporary table.<\/p><p dir=\"ltr\">First, MySQL combines the incoming query with the query defined the view into one query. Then, MySQL executes the combined query<\/p><p dir=\"ltr\">Both of the properties above can be granted by using the \u201c<b><i>MySQL Database Wizard<\/i><\/b>\u201d in the cPanel control panel while you can also grant the privilege for the user to a specific database on Website Panel control panel as well by using the \u201cDatabase manager\u201d option. You may refer below on how to enable the trigger and view on cPanel:<\/p><p dir=\"ltr\">1. Click on the &#8220;<b><i>MySQL<\/i><\/b>&#8221; option.<\/p><p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-1864\" src=\"https:\/\/www.mondoze.com\/guide\/wp-content\/uploads\/2021\/03\/MySQL-1-300x67.png\" alt=\"\" width=\"300\" height=\"67\" \/><\/p><p dir=\"ltr\">2. Click on the database username shown at the &#8220;<b><i>Privileged Users<\/i><\/b>&#8221; column.<\/p><p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-1866\" src=\"https:\/\/www.mondoze.com\/guide\/wp-content\/uploads\/2021\/03\/MySQL-2-300x48.png\" alt=\"\" width=\"300\" height=\"48\" \/><\/p><p dir=\"ltr\">3. Select the required privilege needed to be given to the database as per below.<\/p><p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-medium wp-image-1870\" src=\"https:\/\/www.mondoze.com\/guide\/wp-content\/uploads\/2021\/03\/MySQL-3-300x181.png\" alt=\"\" width=\"300\" height=\"181\" \/><\/p><p dir=\"ltr\">4. Click on the &#8220;<b><i>Make Changes<\/i><\/b>&#8221; button to save the privilege assigned.<\/p><p dir=\"ltr\">5. Done!<\/p>\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>What is MySQL Trigger and View Trigger The MySQL trigger is a database object that is associated with a table. It will be activated when a defined action is executed for the table. The trigger can be executed when you run one of the following MySQL statements on the table: INSERT, UPDATE and DELETE. It &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/www.mondoze.com\/guide\/kb\/mysql-trigger-and-view\"> <span class=\"screen-reader-text\">MySQL Trigger and View<\/span> Read More \u00bb<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"default","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}}},"kbtopic":[123],"kbtag":[110],"mkb_version":[],"_links":{"self":[{"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/kb\/1862"}],"collection":[{"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/kb"}],"about":[{"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/types\/kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/comments?post=1862"}],"version-history":[{"count":9,"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/kb\/1862\/revisions"}],"predecessor-version":[{"id":18502,"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/kb\/1862\/revisions\/18502"}],"wp:attachment":[{"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/media?parent=1862"}],"wp:term":[{"taxonomy":"kbtopic","embeddable":true,"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/kbtopic?post=1862"},{"taxonomy":"kbtag","embeddable":true,"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/kbtag?post=1862"},{"taxonomy":"mkb_version","embeddable":true,"href":"https:\/\/www.mondoze.com\/guide\/wp-json\/wp\/v2\/mkb_version?post=1862"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}