{"id":2664,"date":"2011-11-25T07:43:32","date_gmt":"2011-11-25T07:43:32","guid":{"rendered":"http:\/\/www.bodhost.com\/web-hosting\/?p=2664"},"modified":"2026-02-26T14:04:34","modified_gmt":"2026-02-26T14:04:34","slug":"greensql-application-firewall-for-sql-databases-mysql","status":"publish","type":"post","link":"https:\/\/www.bodhost.com\/kb\/greensql-application-firewall-for-sql-databases-mysql\/","title":{"rendered":"GreenSQL Application Firewall for SQL databases (MySQL)"},"content":{"rendered":"\r\n<p>Having already had to do with SQL injection, it is something very disturbing GreenSQL is a free GPL-licensed solution to protect your MySQL databases from attacks. Such as &#8220;SQL Injection&#8221;, &#8220;Cross-Site Scripting&#8221; and &#8220;Cross-Site requests Forgeries.&#8221;<\/p>\r\n\r\n\r\n\r\n<p>GreenSQL works as a proxy for SQL queries on MySQL databases. Note: that it expected to operate also on the PostgreSQL database using the roadmap. You can also find the post that talks with the title: GreenSQL for PostgreSQL<\/p>\r\n\r\n\r\n\r\n<p>The operation is based on an evaluation of SQL commands using a risk-scoring matrix. (It reminds me that SpamAssassin) and the blocking of administrative commands (DROP, CREATE, etc.).<\/p>\r\n\r\n\r\n\r\n<p>GreenSQL operates in reverse proxy, ie, the SQL query forwarded to GreenSQL analyzes it and then passes it on to MySQL so it accepted.<\/p>\r\n\r\n\r\n\r\n<p>GreenSQL listens on port 3305 and redirects request to port 3306, the port standard of MySQL<\/p>\r\n\r\n\r\n\r\n<p><strong>GreenSQL can operate in different modes:<\/strong><\/p>\r\n\r\n\r\n\r\n<ol>\r\n<li>Simulation (IDS database) &#8211; only detects but not blocking anything<\/li>\r\n<li>Protection (database IPS) &#8211; Detect and block queries<\/li>\r\n<li>Learning Mode<\/li>\r\n<li>Protection against non-listed queries<\/li>\r\n<\/ol>\r\n\r\n\r\n\r\n<p>In the simulation mode, GreenSQL logs in to SQL queries and sends a notification via the administration console to analyze suspicious requests by checking the risk scoring matrix to inform administrators.<\/p>\r\n\r\n\r\n\r\n<p>In Protection mode, if a request considered illegal following questioning of its algorithmic engine, a white list consulted. If it appears in the white list, then it sent to the MySQL engine. But if the request deemed unlawful, GreenSQL returns a null response set to the application on the Web server. Of course with this method, it is possible to have false-positive and false-negative errors \u2026<\/p>\r\n\r\n\r\n\r\n<p>The learning mode is precisely to correct this problem by learning the types of possible queries. It will then switch back to protect against those queries that are not in the SQL query list.<\/p>\r\n\r\n\r\n\r\n<p>When the mode of protection against non-listed queries enabled, applications or queries. That were not included in the white list automatically rejected.<\/p>\r\n\r\n\r\n\r\n<p>GreenSQL will then calculate the risk posed by this application and assemble the information for the management console. This is the fastest mode because it only calculates the risk for new requests.<\/p>\r\n\r\n\r\n\r\n<p>That is basically the operation of GreenSQL, which I think really be a very interesting solution, although the best is still to predict risks in the development, regarding the performance of the web application, it does not appear as if it impacted a performance test performed with the use of GreenSQL.<\/p>\r\n\r\n\r\n\r\n<p>Note: GreenSQL packages are provided for the most common Linux distributions (CentOS, Debian, Fedora, Mandriva, RHEL 5, 5 SLE, Opensuse, Ubuntu)<\/p>\r\n","protected":false},"excerpt":{"rendered":"<p>Having already had to do with SQL injection, it is something very disturbing GreenSQL is a free GPL-licensed solution to protect your MySQL databases from attacks. Such as &#8220;SQL Injection&#8221;,&hellip;<\/p>\n<p><a href=\"https:\/\/www.bodhost.com\/kb\/greensql-application-firewall-for-sql-databases-mysql\/\" class=\"more-link\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[664],"tags":[389,388,206,387],"class_list":["post-2664","post","type-post","status-publish","format-standard","hentry","category-web-hosting","tag-database-security","tag-greensql","tag-mysql","tag-sql-databases"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>GreenSQL Application Firewall \u2013 Protect SQL Databases<\/title>\n<meta name=\"description\" content=\"how GreenSQL Application Firewall protects SQL databases. Enhance database security, prevent SQL injection, and monitor suspicious activity effectively.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.bodhost.com\/kb\/greensql-application-firewall-for-sql-databases-mysql\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"GreenSQL Application Firewall \u2013 Protect SQL Databases\" \/>\n<meta property=\"og:description\" content=\"how GreenSQL Application Firewall protects SQL databases. Enhance database security, prevent SQL injection, and monitor suspicious activity effectively.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.bodhost.com\/kb\/greensql-application-firewall-for-sql-databases-mysql\/\" \/>\n<meta property=\"og:site_name\" content=\"Knowledge Base - bodHOST\" \/>\n<meta property=\"article:published_time\" content=\"2011-11-25T07:43:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-26T14:04:34+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/greensql-application-firewall-for-sql-databases-mysql\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/greensql-application-firewall-for-sql-databases-mysql\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/c48414ad1536cea20e85282b0737a9f9\"},\"headline\":\"GreenSQL Application Firewall for SQL databases (MySQL)\",\"datePublished\":\"2011-11-25T07:43:32+00:00\",\"dateModified\":\"2026-02-26T14:04:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/greensql-application-firewall-for-sql-databases-mysql\\\/\"},\"wordCount\":432,\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"keywords\":[\"Database Security\",\"GreenSQL\",\"MySQL\",\"SQL databases\"],\"articleSection\":[\"Web Hosting\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/greensql-application-firewall-for-sql-databases-mysql\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/greensql-application-firewall-for-sql-databases-mysql\\\/\",\"name\":\"GreenSQL Application Firewall \u2013 Protect SQL Databases\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\"},\"datePublished\":\"2011-11-25T07:43:32+00:00\",\"dateModified\":\"2026-02-26T14:04:34+00:00\",\"description\":\"how GreenSQL Application Firewall protects SQL databases. Enhance database security, prevent SQL injection, and monitor suspicious activity effectively.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/greensql-application-firewall-for-sql-databases-mysql\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/greensql-application-firewall-for-sql-databases-mysql\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/greensql-application-firewall-for-sql-databases-mysql\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Web Hosting\",\"item\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/category\\\/web-hosting\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"GreenSQL Application Firewall for SQL databases (MySQL)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"alternateName\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"contentUrl\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"width\":240,\"height\":240,\"caption\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/c48414ad1536cea20e85282b0737a9f9\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/author\\\/admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"GreenSQL Application Firewall \u2013 Protect SQL Databases","description":"how GreenSQL Application Firewall protects SQL databases. Enhance database security, prevent SQL injection, and monitor suspicious activity effectively.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.bodhost.com\/kb\/greensql-application-firewall-for-sql-databases-mysql\/","og_locale":"en_US","og_type":"article","og_title":"GreenSQL Application Firewall \u2013 Protect SQL Databases","og_description":"how GreenSQL Application Firewall protects SQL databases. Enhance database security, prevent SQL injection, and monitor suspicious activity effectively.","og_url":"https:\/\/www.bodhost.com\/kb\/greensql-application-firewall-for-sql-databases-mysql\/","og_site_name":"Knowledge Base - bodHOST","article_published_time":"2011-11-25T07:43:32+00:00","article_modified_time":"2026-02-26T14:04:34+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.bodhost.com\/kb\/greensql-application-firewall-for-sql-databases-mysql\/#article","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/greensql-application-firewall-for-sql-databases-mysql\/"},"author":{"name":"admin","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/c48414ad1536cea20e85282b0737a9f9"},"headline":"GreenSQL Application Firewall for SQL databases (MySQL)","datePublished":"2011-11-25T07:43:32+00:00","dateModified":"2026-02-26T14:04:34+00:00","mainEntityOfPage":{"@id":"https:\/\/www.bodhost.com\/kb\/greensql-application-firewall-for-sql-databases-mysql\/"},"wordCount":432,"publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"keywords":["Database Security","GreenSQL","MySQL","SQL databases"],"articleSection":["Web Hosting"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.bodhost.com\/kb\/greensql-application-firewall-for-sql-databases-mysql\/","url":"https:\/\/www.bodhost.com\/kb\/greensql-application-firewall-for-sql-databases-mysql\/","name":"GreenSQL Application Firewall \u2013 Protect SQL Databases","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/#website"},"datePublished":"2011-11-25T07:43:32+00:00","dateModified":"2026-02-26T14:04:34+00:00","description":"how GreenSQL Application Firewall protects SQL databases. Enhance database security, prevent SQL injection, and monitor suspicious activity effectively.","breadcrumb":{"@id":"https:\/\/www.bodhost.com\/kb\/greensql-application-firewall-for-sql-databases-mysql\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.bodhost.com\/kb\/greensql-application-firewall-for-sql-databases-mysql\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.bodhost.com\/kb\/greensql-application-firewall-for-sql-databases-mysql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Web Hosting","item":"https:\/\/www.bodhost.com\/kb\/category\/web-hosting\/"},{"@type":"ListItem","position":2,"name":"GreenSQL Application Firewall for SQL databases (MySQL)"}]},{"@type":"WebSite","@id":"https:\/\/www.bodhost.com\/kb\/#website","url":"https:\/\/www.bodhost.com\/kb\/","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","description":"","publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"alternateName":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.bodhost.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.bodhost.com\/kb\/#organization","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","url":"https:\/\/www.bodhost.com\/kb\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/","url":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","contentUrl":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","width":240,"height":240,"caption":"Web Hosting Knowledge Base | bodHOST Hosting FAQ"},"image":{"@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/c48414ad1536cea20e85282b0737a9f9","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/51e53199212db3f59606920448d45a6ead224f904558e3ab9251d071a609b202?s=96&d=mm&r=g","caption":"admin"},"url":"https:\/\/www.bodhost.com\/kb\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/2664","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/comments?post=2664"}],"version-history":[{"count":5,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/2664\/revisions"}],"predecessor-version":[{"id":12319,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/2664\/revisions\/12319"}],"wp:attachment":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/media?parent=2664"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/categories?post=2664"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/tags?post=2664"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}