{"id":1703,"date":"2012-01-30T16:29:03","date_gmt":"2012-01-30T16:29:03","guid":{"rendered":"http:\/\/kedar.nitty-witty.com\/?p=1703"},"modified":"2014-06-25T13:11:48","modified_gmt":"2014-06-25T13:11:48","slug":"access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security","status":"publish","type":"post","link":"https:\/\/kedar.nitty-witty.com\/blog\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security","title":{"rendered":"Access Control in MySQL Stored Routines: DEFINER, INVOKER &#038; SQL SECURITY"},"content":{"rendered":"<p>MySQL Stored Routines (functions and procedures) are not only used for improving performance but also they&#8217;re handy when it comes to enhancing security and restricting user access. This post briefs you about security aspects of stored routines by means of example.<\/p>\n<p>By the definition of a Stored Routine,<br \/>\n&#8211; DEFINER clause specifies the creator of the stored routine.<br \/>\n&#8211; SQL SECURITY clause specifies the execution context of the stored routine.<\/p>\n<p>Now let&#8217;s start with an example:<\/p>\n<p>Create a very basic stored routine in test database:<\/p>\n<p><code>DELIMITER \/\/<br \/>\nCREATE PROCEDURE user_cnt()<br \/>\nBEGIN<br \/>\n  SELECT COUNT(*) as total_user FROM mysql.user;<br \/>\nEND;\/\/<br \/>\nDELIMITER ;<\/code><\/p>\n<p>Our current user is: root@localhost<br \/>\n[ You can see your current user by issuing <code>select CURRENT_USER(); <\/code> ]<\/p>\n<p>Call the procedure:<br \/>\n<code>CALL user_cnt()\\G<br \/>\ntotal_user: 10<\/code><\/p>\n<p>Here, We created a stored routine using root@localhost user.<br \/>\n&#8211; DEFINER: The user who creates this procedure. i.e. root@localhost<br \/>\n&#8211; SQL SECURITY: Defines under whose privileges the routine will be executed; defaults to DEFINER. i.e. root@localhost<\/p>\n<p>As SQL SECURITY is set to DEFINER, a user even with only EXECUTE permission for routine can call and get the output of the stored routine regardless of whether that user has permission on mysql database or not. <\/p>\n<p>Lets see how this works. Create a &#8220;execuser&#8221; with limited privileges:<br \/>\n<code>GRANT EXECUTE ON test.* TO 'execuser'@'localhost' IDENTIFIED BY 'execuser' ;<br \/>\nFLUSH PRIVILEGEES;<\/code><\/p>\n<p>Login using execuser to mysql prompt and call the procedure created under test database:<br \/>\n<code>mysql> CALL user_cnt()\\G<br \/>\ntotal_user: 10<\/code><\/p>\n<p>Now check that below command fired by execuser fails due to lack of privileges:<br \/>\n<code>mysql> select count(*) from mysql.user;<br \/>\nERROR 1142 (42000): SELECT command denied to user 'execuser'@'localhost' for table 'user'<\/code><\/p>\n<p>&#8211; Thus stored procedure allows us to restrict users to access tables directly but still getting access to certain data.<br \/>\n&#8211; User execuser@localhost is not having permission on mysql database and still he could get the data.<br \/>\n&#8211; As the SQL SECURITY was set to DEFINER (default), the execution of the routine happened under the security context of root@localhost user and returned the result. <\/p>\n<p>Is this behaviour something that you don&#8217;t want to happen? Hmmm we have a way out here.<br \/>\nLets rewrite the stored procedure as below:<\/p>\n<p><code>DELIMITER \/\/<br \/>\nDROP PROCEDURE IF EXISTS user_cnt;<br \/>\nCREATE DEFINER='root'@'localhost' PROCEDURE user_cnt()<br \/>\nSQL SECURITY INVOKER<br \/>\nBEGIN<br \/>\n  SELECT COUNT(*) as total_user FROM mysql.user;<br \/>\nEND;\/\/<br \/>\nDELIMITER ;<\/code><\/p>\n<p>&#8211; Did you note &#8220;SQL SECURITY INVOKER&#8221;!! That&#8217;s our saviour.<br \/>\n&#8211; We&#8217;ve specified the DEFINER attribute explicitly.<br \/>\n&#8211; SQL SECURITY decides under whose privileges the stored routine gets executed! Here it is INVOKER, the user that CALLs the routine!<\/p>\n<p>Let&#8217;s check through execuser@localhost user:<br \/>\n<code>mysql> call user_cnt();<br \/>\nERROR 1142 (42000): SELECT command denied to user 'execuser'@'localhost' for table 'user'<\/code><\/p>\n<p>So, this is now pretty clear that the stored routine tried to execute the SELECT query under INVOKER&#8217;s (execuser@localhost) privileges; and the routine failed as the INVOKER has no privileges on user table.<\/p>\n<p>Finally, a few points:<br \/>\nTogether DEFINER &#038; SQL SECURITY clauses define the security context to be used during routine execution time.<br \/>\nThe DEFINER attribute defaults to the current user &#038; defines the creator of the Stored Routine.<br \/>\nSQL SECURITY defines the execution permission of the stored routine and defaults to DEFINER.<\/p>\n<p>I hope this cleared the basics; thanks for reading.<\/p>\n","protected":false},"excerpt":{"rendered":"MySQL Stored Routines (functions and procedures) are not only used for improving performance but also they&#8217;re handy when it comes to enhancing security and restricting user access. This post briefs&hellip;\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[8,377],"tags":[299,300,301,427,303,298,302],"class_list":["post-1703","post","type-post","status-publish","format-standard","category-mysql","category-mysql-articles","tag-acess-control","tag-definer","tag-invoker","tag-mysql","tag-mysql-stored-procedure","tag-mysql-stored-routines","tag-sql-security"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"Access Control in MySQL Stored Routines: DEFINER, INVOKER &amp; SQL SECURITY explained by examples.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Kedar\"\/>\n\t<meta name=\"google-site-verification\" content=\"_Bu1h5r0PxIC0D2jBVdmYN45RTeG9ogcX85XLkbG1qA\" \/>\n\t<meta name=\"msvalidate.01\" content=\"116B62074CBCA1BA99B8CCE09CCF2FB8\" \/>\n\t<meta name=\"keywords\" content=\"mysql stored routines,acess control,definer,invoker,sql security,mysql stored procedure,mysql\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/kedar.nitty-witty.com\/blog\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Change Is Inevitable | Kedar Vaijanapurkar&#039;s Blog for MySQL, technology and various subjects\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Access Control in MySQL Stored Routines: DEFINER, INVOKER &amp; SQL SECURITY | Change Is Inevitable\" \/>\n\t\t<meta property=\"og:description\" content=\"Access Control in MySQL Stored Routines: DEFINER, INVOKER &amp; SQL SECURITY explained by examples.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/kedar.nitty-witty.com\/blog\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2012-01-30T16:29:03+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2014-06-25T13:11:48+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Access Control in MySQL Stored Routines: DEFINER, INVOKER &amp; SQL SECURITY | Change Is Inevitable\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Access Control in MySQL Stored Routines: DEFINER, INVOKER &amp; SQL SECURITY explained by examples.\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security#article\",\"name\":\"Access Control in MySQL Stored Routines: DEFINER, INVOKER & SQL SECURITY | Change Is Inevitable\",\"headline\":\"Access Control in MySQL Stored Routines: DEFINER, INVOKER &#038; SQL SECURITY\",\"author\":{\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/author\\\/admin#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/#person\"},\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security#articleImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/be1f7021485c325d92cc4c5d961accb9c1af72b1b11281a790f7f4f066ef10d3?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Kedar\"},\"datePublished\":\"2012-01-30T16:29:03+00:00\",\"dateModified\":\"2014-06-25T13:11:48+00:00\",\"inLanguage\":\"en-US\",\"commentCount\":6,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security#webpage\"},\"articleSection\":\"MySQL, MySQL-Articles, Acess Control, Definer, Invoker, MySQL, mysql stored procedure, MySQL Stored Routines, SQL SECURITY\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/category\\\/mysql#listItem\",\"name\":\"MySQL\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/category\\\/mysql#listItem\",\"position\":2,\"name\":\"MySQL\",\"item\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/category\\\/mysql\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/category\\\/mysql\\\/mysql-articles#listItem\",\"name\":\"MySQL-Articles\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/category\\\/mysql\\\/mysql-articles#listItem\",\"position\":3,\"name\":\"MySQL-Articles\",\"item\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/category\\\/mysql\\\/mysql-articles\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security#listItem\",\"name\":\"Access Control in MySQL Stored Routines: DEFINER, INVOKER &#038; SQL SECURITY\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/category\\\/mysql#listItem\",\"name\":\"MySQL\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security#listItem\",\"position\":4,\"name\":\"Access Control in MySQL Stored Routines: DEFINER, INVOKER &#038; SQL SECURITY\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/category\\\/mysql\\\/mysql-articles#listItem\",\"name\":\"MySQL-Articles\"}}]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/#person\",\"name\":\"Kedar\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security#personImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/be1f7021485c325d92cc4c5d961accb9c1af72b1b11281a790f7f4f066ef10d3?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Kedar\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/author\\\/admin#author\",\"url\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/author\\\/admin\",\"name\":\"Kedar\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/be1f7021485c325d92cc4c5d961accb9c1af72b1b11281a790f7f4f066ef10d3?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"Kedar\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security#webpage\",\"url\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security\",\"name\":\"Access Control in MySQL Stored Routines: DEFINER, INVOKER & SQL SECURITY | Change Is Inevitable\",\"description\":\"Access Control in MySQL Stored Routines: DEFINER, INVOKER & SQL SECURITY explained by examples.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/author\\\/admin#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/author\\\/admin#author\"},\"datePublished\":\"2012-01-30T16:29:03+00:00\",\"dateModified\":\"2014-06-25T13:11:48+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/\",\"name\":\"..::CHANGE is INEVITABLE::..\",\"description\":\"Kedar Vaijanapurkar's Blog for MySQL, technology and various subjects\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/kedar.nitty-witty.com\\\/blog\\\/#person\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Access Control in MySQL Stored Routines: DEFINER, INVOKER & SQL SECURITY | Change Is Inevitable","description":"Access Control in MySQL Stored Routines: DEFINER, INVOKER & SQL SECURITY explained by examples.","canonical_url":"https:\/\/kedar.nitty-witty.com\/blog\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security","robots":"max-image-preview:large","keywords":"mysql stored routines,acess control,definer,invoker,sql security,mysql stored procedure,mysql","webmasterTools":{"google-site-verification":"_Bu1h5r0PxIC0D2jBVdmYN45RTeG9ogcX85XLkbG1qA","msvalidate.01":"116B62074CBCA1BA99B8CCE09CCF2FB8","miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/kedar.nitty-witty.com\/blog\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security#article","name":"Access Control in MySQL Stored Routines: DEFINER, INVOKER & SQL SECURITY | Change Is Inevitable","headline":"Access Control in MySQL Stored Routines: DEFINER, INVOKER &#038; SQL SECURITY","author":{"@id":"https:\/\/kedar.nitty-witty.com\/blog\/author\/admin#author"},"publisher":{"@id":"https:\/\/kedar.nitty-witty.com\/blog\/#person"},"image":{"@type":"ImageObject","@id":"https:\/\/kedar.nitty-witty.com\/blog\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security#articleImage","url":"https:\/\/secure.gravatar.com\/avatar\/be1f7021485c325d92cc4c5d961accb9c1af72b1b11281a790f7f4f066ef10d3?s=96&d=mm&r=g","width":96,"height":96,"caption":"Kedar"},"datePublished":"2012-01-30T16:29:03+00:00","dateModified":"2014-06-25T13:11:48+00:00","inLanguage":"en-US","commentCount":6,"mainEntityOfPage":{"@id":"https:\/\/kedar.nitty-witty.com\/blog\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security#webpage"},"isPartOf":{"@id":"https:\/\/kedar.nitty-witty.com\/blog\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security#webpage"},"articleSection":"MySQL, MySQL-Articles, Acess Control, Definer, Invoker, MySQL, mysql stored procedure, MySQL Stored Routines, SQL SECURITY"},{"@type":"BreadcrumbList","@id":"https:\/\/kedar.nitty-witty.com\/blog\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/kedar.nitty-witty.com\/blog#listItem","position":1,"name":"Home","item":"https:\/\/kedar.nitty-witty.com\/blog","nextItem":{"@type":"ListItem","@id":"https:\/\/kedar.nitty-witty.com\/blog\/category\/mysql#listItem","name":"MySQL"}},{"@type":"ListItem","@id":"https:\/\/kedar.nitty-witty.com\/blog\/category\/mysql#listItem","position":2,"name":"MySQL","item":"https:\/\/kedar.nitty-witty.com\/blog\/category\/mysql","nextItem":{"@type":"ListItem","@id":"https:\/\/kedar.nitty-witty.com\/blog\/category\/mysql\/mysql-articles#listItem","name":"MySQL-Articles"},"previousItem":{"@type":"ListItem","@id":"https:\/\/kedar.nitty-witty.com\/blog#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/kedar.nitty-witty.com\/blog\/category\/mysql\/mysql-articles#listItem","position":3,"name":"MySQL-Articles","item":"https:\/\/kedar.nitty-witty.com\/blog\/category\/mysql\/mysql-articles","nextItem":{"@type":"ListItem","@id":"https:\/\/kedar.nitty-witty.com\/blog\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security#listItem","name":"Access Control in MySQL Stored Routines: DEFINER, INVOKER &#038; SQL SECURITY"},"previousItem":{"@type":"ListItem","@id":"https:\/\/kedar.nitty-witty.com\/blog\/category\/mysql#listItem","name":"MySQL"}},{"@type":"ListItem","@id":"https:\/\/kedar.nitty-witty.com\/blog\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security#listItem","position":4,"name":"Access Control in MySQL Stored Routines: DEFINER, INVOKER &#038; SQL SECURITY","previousItem":{"@type":"ListItem","@id":"https:\/\/kedar.nitty-witty.com\/blog\/category\/mysql\/mysql-articles#listItem","name":"MySQL-Articles"}}]},{"@type":"Person","@id":"https:\/\/kedar.nitty-witty.com\/blog\/#person","name":"Kedar","image":{"@type":"ImageObject","@id":"https:\/\/kedar.nitty-witty.com\/blog\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security#personImage","url":"https:\/\/secure.gravatar.com\/avatar\/be1f7021485c325d92cc4c5d961accb9c1af72b1b11281a790f7f4f066ef10d3?s=96&d=mm&r=g","width":96,"height":96,"caption":"Kedar"}},{"@type":"Person","@id":"https:\/\/kedar.nitty-witty.com\/blog\/author\/admin#author","url":"https:\/\/kedar.nitty-witty.com\/blog\/author\/admin","name":"Kedar","image":{"@type":"ImageObject","@id":"https:\/\/kedar.nitty-witty.com\/blog\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/be1f7021485c325d92cc4c5d961accb9c1af72b1b11281a790f7f4f066ef10d3?s=96&d=mm&r=g","width":96,"height":96,"caption":"Kedar"}},{"@type":"WebPage","@id":"https:\/\/kedar.nitty-witty.com\/blog\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security#webpage","url":"https:\/\/kedar.nitty-witty.com\/blog\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security","name":"Access Control in MySQL Stored Routines: DEFINER, INVOKER & SQL SECURITY | Change Is Inevitable","description":"Access Control in MySQL Stored Routines: DEFINER, INVOKER & SQL SECURITY explained by examples.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/kedar.nitty-witty.com\/blog\/#website"},"breadcrumb":{"@id":"https:\/\/kedar.nitty-witty.com\/blog\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security#breadcrumblist"},"author":{"@id":"https:\/\/kedar.nitty-witty.com\/blog\/author\/admin#author"},"creator":{"@id":"https:\/\/kedar.nitty-witty.com\/blog\/author\/admin#author"},"datePublished":"2012-01-30T16:29:03+00:00","dateModified":"2014-06-25T13:11:48+00:00"},{"@type":"WebSite","@id":"https:\/\/kedar.nitty-witty.com\/blog\/#website","url":"https:\/\/kedar.nitty-witty.com\/blog\/","name":"..::CHANGE is INEVITABLE::..","description":"Kedar Vaijanapurkar's Blog for MySQL, technology and various subjects","inLanguage":"en-US","publisher":{"@id":"https:\/\/kedar.nitty-witty.com\/blog\/#person"}}]},"og:locale":"en_US","og:site_name":"Change Is Inevitable | Kedar Vaijanapurkar's Blog for MySQL, technology and various subjects","og:type":"article","og:title":"Access Control in MySQL Stored Routines: DEFINER, INVOKER &amp; SQL SECURITY | Change Is Inevitable","og:description":"Access Control in MySQL Stored Routines: DEFINER, INVOKER &amp; SQL SECURITY explained by examples.","og:url":"https:\/\/kedar.nitty-witty.com\/blog\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security","article:published_time":"2012-01-30T16:29:03+00:00","article:modified_time":"2014-06-25T13:11:48+00:00","twitter:card":"summary","twitter:title":"Access Control in MySQL Stored Routines: DEFINER, INVOKER &amp; SQL SECURITY | Change Is Inevitable","twitter:description":"Access Control in MySQL Stored Routines: DEFINER, INVOKER &amp; SQL SECURITY explained by examples."},"aioseo_meta_data":{"post_id":"1703","title":"Access Control in MySQL Stored Routines: DEFINER, INVOKER &amp; SQL SECURITY | #site_title","description":"Access Control in MySQL Stored Routines: DEFINER, INVOKER &amp; SQL SECURITY explained by examples.","keywords":[{"label":"MySQL Stored Routines","value":"MySQL Stored Routines"},{"label":"Acess Control","value":"Acess Control"},{"label":"Definer","value":"Definer"},{"label":"Invoker","value":"Invoker"},{"label":"SQL SECURITY","value":"SQL SECURITY"},{"label":"mysql stored procedure","value":"mysql stored procedure"}],"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"Article","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2021-03-24 17:43:00","updated":"2025-08-16 19:12:30","seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/kedar.nitty-witty.com\/blog\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/kedar.nitty-witty.com\/blog\/category\/mysql\" title=\"MySQL\">MySQL<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/kedar.nitty-witty.com\/blog\/category\/mysql\/mysql-articles\" title=\"MySQL-Articles\">MySQL-Articles<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tAccess Control in MySQL Stored Routines: DEFINER, INVOKER &amp; SQL SECURITY\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/kedar.nitty-witty.com\/blog"},{"label":"MySQL","link":"https:\/\/kedar.nitty-witty.com\/blog\/category\/mysql"},{"label":"MySQL-Articles","link":"https:\/\/kedar.nitty-witty.com\/blog\/category\/mysql\/mysql-articles"},{"label":"Access Control in MySQL Stored Routines: DEFINER, INVOKER &#038; SQL SECURITY","link":"https:\/\/kedar.nitty-witty.com\/blog\/access-control-in-mysql-stored-routines-by-example-definer-invoker-sql-security"}],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/posts\/1703","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/comments?post=1703"}],"version-history":[{"count":11,"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/posts\/1703\/revisions"}],"predecessor-version":[{"id":1712,"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/posts\/1703\/revisions\/1712"}],"wp:attachment":[{"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/media?parent=1703"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/categories?post=1703"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kedar.nitty-witty.com\/blog\/wp-json\/wp\/v2\/tags?post=1703"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}