<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Sql on Micha Kops&#39; Tech Notes</title>
    <link>https://www.hascode.com/tags/sql/</link>
    <description>Recent content in Sql on Micha Kops&#39; Tech Notes</description>
    <generator>Hugo</generator>
    <language>en</language>
    <copyright>Copyright © 2010 - 2025 Micha Kops. #e9d956c0c0154a221ad83c925346a8fa0e72f866</copyright>
    <lastBuildDate>Wed, 29 Mar 2023 00:00:00 +0200</lastBuildDate>
    <atom:link href="https://www.hascode.com/tags/sql/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Postgres with docker-compose or Docker and pg_stat_statements enabled</title>
      <link>https://www.hascode.com/postgres-with-docker-compose-or-docker-and-pg_stat_statements-enabled/</link>
      <pubDate>Wed, 29 Mar 2023 00:00:00 +0200</pubDate>
      <guid>https://www.hascode.com/postgres-with-docker-compose-or-docker-and-pg_stat_statements-enabled/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;&lt;a href=&#34;https://www.postgresql.org/docs/9.3/pgstatstatements.html&#34;&gt;pg_stat_statements&lt;/a&gt; is useful to gather performance information
about queries so lets add it to our dockerized postgres database.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_using_docker_compose&#34;&gt;Using docker-compose&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Using &lt;a href=&#34;https://docs.docker.com/compose/&#34;&gt;docker-compose&lt;/a&gt; we just need to add the following &lt;code&gt;docker-compose.yaml&lt;/code&gt;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;title&#34;&gt;docker-compose.yml&lt;/div&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;version: &amp;#39;3.5&amp;#39;

services:
  postgres:
    container_name: postgres_container
    image: postgres
    ports:
      - &amp;#34;5432:5432&amp;#34;
    volumes:
      - /var/lib/postgresql/data
    # used for query profiling, deactivate for enhanced performance
    command: postgres -c shared_preload_libraries=pg_stat_statements -c pg_stat_statements.track=all -c max_connections=200
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: thepassword&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;We simply start our Postgres database with &lt;code&gt;docker-compose&lt;/code&gt;:&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>Setting up multiple Postgresql Instances with docker-compose</title>
      <link>https://www.hascode.com/setting-up-multiple-postgresql-instances-with-docker-compose/</link>
      <pubDate>Tue, 08 Feb 2022 00:00:00 +0100</pubDate>
      <guid>https://www.hascode.com/setting-up-multiple-postgresql-instances-with-docker-compose/</guid>
      <description>&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;A simple setup when two Postgres databases prefilled with schema/data needed.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;title&#34;&gt;docker-compose.yml&lt;/div&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;version: &amp;#39;3.6&amp;#39;
services:
    postgres1:
        image: postgres
        restart: always
        environment:
            - DATABASE_HOST=127.0.0.1
            - POSTGRES_USER=root
            - POSTGRES_PASSWORD=root
            - POSTGRES_DB=root
        ports:
            - &amp;#34;15432:15432&amp;#34;
        volumes:
            - ./postgres1-init.sql:/docker-entrypoint-initdb.d/docker_postgres_init.sql

    postgres2:
        image: postgres
        restart: always
        environment:
            - DATABASE_HOST=127.0.0.1
            - POSTGRES_USER=root
            - POSTGRES_PASSWORD=root
            - POSTGRES_DB=root

        ports:
            - &amp;#34;25432:25432&amp;#34;
        volumes:
            - ./postgres2-init.sql:/docker-entrypoint-initdb.d/docker_postgres_init.sql&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;And our sample init scripts:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;CREATE USER tester WITH PASSWORD &amp;#39;tester&amp;#39; CREATEDB;
CREATE DATABASE testdb
    WITH
    OWNER = tester
    ENCODING = &amp;#39;UTF8&amp;#39;
    LC_COLLATE = &amp;#39;en_US.utf8&amp;#39;
    LC_CTYPE = &amp;#39;en_US.utf8&amp;#39;
    TABLESPACE = pg_default
    CONNECTION LIMIT = -1;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>WordPress Docker Setup</title>
      <link>https://www.hascode.com/wordpress-docker-setup/</link>
      <pubDate>Fri, 14 May 2021 00:00:00 +0200</pubDate>
      <guid>https://www.hascode.com/wordpress-docker-setup/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;sidebarblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;div class=&#34;title&#34;&gt;Goals&lt;/div&gt;
&lt;div class=&#34;olist arabic&#34;&gt;
&lt;ol class=&#34;arabic&#34;&gt;
&lt;li&gt;
&lt;p&gt;Run WordPress via Docker / Docker-Compose&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Increase the Upload Filesize Limit&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_create_docker_compose_configuration&#34;&gt;Create Docker Compose Configuration&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Create a &lt;code&gt;docker-compose.yml&lt;/code&gt;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-yaml&#34; data-lang=&#34;yaml&#34;&gt;version: &amp;#39;3.1&amp;#39;

services:

  wordpress:
    image: wordpress
    restart: always
    ports:
      - 8080:80
    environment:
      WORDPRESS_DB_HOST: db
      WORDPRESS_DB_USER: exampleuser
      WORDPRESS_DB_PASSWORD: examplepass
      WORDPRESS_DB_NAME: exampledb
    volumes:
      - wordpress:/var/www/html

  db:
    image: mysql:5.7
    restart: always
    environment:
      MYSQL_DATABASE: exampledb
      MYSQL_USER: exampleuser
      MYSQL_PASSWORD: examplepass
      MYSQL_RANDOM_ROOT_PASSWORD: &amp;#39;1&amp;#39;
    volumes:
      - db:/var/lib/mysql

volumes:
  wordpress:
  db:&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_run_docker_compose_start_containers&#34;&gt;Run Docker Compose / Start Containers&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-bash&#34; data-lang=&#34;bash&#34;&gt;docker-compose up
WARNING: Found orphan containers (wordpress-docker_phpmyadmin_1) for this project. If you removed or renamed this service in your compose file, you can run this command with the --remove-orphans flag to clean it up.
Starting wordpress-docker_db_1        ... done
Starting wordpress-docker_wordpress_1 ... done
Attaching to wordpress-docker_db_1, wordpress-docker_wordpress_1
[..]
db_1         | 2021-04-03T18:58:17.247963Z 0 [Note] mysqld: ready for connections.
db_1         | Version: &amp;#39;5.7.33&amp;#39;  socket: &amp;#39;/var/run/mysqld/mysqld.sock&amp;#39;  port: 3306  MySQL Community Server (GPL)&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>Using jOOQ and Build Helper Plugin to Generate Database Metamodels with Maven</title>
      <link>https://www.hascode.com/using-jooq-and-build-helper-plugin-to-generate-database-metamodels-with-maven/</link>
      <pubDate>Tue, 10 Jun 2014 00:00:00 +0200</pubDate>
      <guid>https://www.hascode.com/using-jooq-and-build-helper-plugin-to-generate-database-metamodels-with-maven/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;When you need to derive meta-models from existing databases and want to create type-safe queries with an elegant, fluent-API, jOOQ definitely is a tool to consider here.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;In the following tutorial I’d like to demonstrate how to integrate the jOOQ meta-model generator into a Maven build using the jOOQ Maven Plug-in, the Build Helper Maven Plug-in and Maven profiles to finally create a running application to query an existing RDBMS using such a generated meta-model.&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>Creating elegant, typesafe Queries for JPA, mongoDB Morphia and Lucene using Querydsl</title>
      <link>https://www.hascode.com/creating-elegant-typesafe-queries-for-jpa-mongodb-morphia-and-lucene-using-querydsl/</link>
      <pubDate>Thu, 13 Feb 2014 00:00:00 +0100</pubDate>
      <guid>https://www.hascode.com/creating-elegant-typesafe-queries-for-jpa-mongodb-morphia-and-lucene-using-querydsl/</guid>
      <description>&lt;div id=&#34;preamble&#34;&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Querydsl is a framework that allows us to create elegant, type-safe queries for a variety of different data-sources like Java Persistence API (JPA) entities, Java Data Objects (JDO), mongoDB with Morphia, SQL, Hibernate Search up to Lucene.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;In the following tutorial we’re implementing example queries for different environments – Java Persistence API compared with a JPQL and a criteria API query, mongoDB with Morphia and last but not least for Lucene.&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>MyBatis Snippets</title>
      <link>https://www.hascode.com/mybatis-snippets/</link>
      <pubDate>Mon, 01 Mar 2010 00:00:00 +0100</pubDate>
      <guid>https://www.hascode.com/mybatis-snippets/</guid>
      <description>&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_use_list_of_parameters_in_annotation_based_query&#34;&gt;Use List of Parameters in Annotation-based Query&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Possible using MyBatis &lt;a href=&#34;https://mybatis.org/mybatis-3/dynamic-sql.html&#34;&gt;Dynamic SQL feature&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-java&#34; data-lang=&#34;java&#34;&gt;package com.hascode.example.mybatis;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SampleMapper {

    @Select({&amp;#34;&amp;lt;script&amp;gt;&amp;#34;,
             &amp;#34;SELECT sample.bar&amp;#34;,
             &amp;#34;FROM sampletable sample&amp;#34;,
             &amp;#34;WHERE sample.id IN&amp;#34;,
            &amp;#34;&amp;lt;foreach item=&amp;#39;item&amp;#39; index=&amp;#39;index&amp;#39; collection=&amp;#39;ids&amp;#39;&amp;#34;,
            &amp;#34;open=&amp;#39;(&amp;#39; separator=&amp;#39;,&amp;#39; close=&amp;#39;)&amp;#39;&amp;gt;&amp;#34;,
            &amp;#34;#{item}&amp;#34;,
            &amp;#34;&amp;lt;/foreach&amp;gt;&amp;#34;,
            &amp;#34;&amp;lt;/script&amp;gt;&amp;#34;})
    List&amp;lt;Foo&amp;gt; getSamplesMatchingIds(@Param(&amp;#34;ids&amp;#34;) List&amp;lt;String&amp;gt; ids);
}&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;The mapper may now be used with a list of parameter objects:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-java&#34; data-lang=&#34;java&#34;&gt;var samples = sampleMapper.getSamplesMatchingIds(List.of(&amp;#34;24059e5b-aa07-424d-855e-50f499b8f697&amp;#34;, &amp;#34;65140fc0-fc9f-42d2-9531-5e5d6caeba30&amp;#34;));&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_call_a_procedure&#34;&gt;Call a Procedure&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-java&#34; data-lang=&#34;java&#34;&gt;package com.hascode.example.mybatis;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.mapping.StatementType;

@Mapper
public interface SampleMapper {

    @Select(&amp;#34;CALL SCHEMA.CL.setScope(#{scope})&amp;#34;)
    @Options(statementType = StatementType.CALLABLE)
    void setScope(int scope);
}&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>Postgres Snippets</title>
      <link>https://www.hascode.com/postgres-snippets/</link>
      <pubDate>Mon, 01 Mar 2010 00:00:00 +0100</pubDate>
      <guid>https://www.hascode.com/postgres-snippets/</guid>
      <description>&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_administration_configuration&#34;&gt;Administration &amp;amp; Configuration&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;sect2&#34;&gt;
&lt;h3 id=&#34;_connections&#34;&gt;Connections&lt;/h3&gt;
&lt;div class=&#34;sect3&#34;&gt;
&lt;h4 id=&#34;_show_max_connections_value_and_source&#34;&gt;Show Max Connections (value and source)&lt;/h4&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;SELECT setting, source, sourcefile, sourceline
FROM pg_settings
WHERE name = &amp;#39;max_connections&amp;#39;;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect3&#34;&gt;
&lt;h4 id=&#34;_set_max_connections&#34;&gt;Set Max Connections&lt;/h4&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;ALTER system SET max_connections = 250;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect3&#34;&gt;
&lt;h4 id=&#34;_kill_connections_for_a_database&#34;&gt;Kill Connections for a Database&lt;/h4&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;SELECT pg_terminate_backend(pid)
FROM pg_catalog.pg_stat_activity
-- we don&amp;#39;t want to kill our own connection
WHERE pid != pg_backend_pid()
-- we don&amp;#39;t want to kill connections to other databases
AND datname = &amp;#39;MYDATABASE&amp;#39;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect3&#34;&gt;
&lt;h4 id=&#34;_show_statement_timeout_settings_for_all_users&#34;&gt;Show Statement Timeout Settings for All Users&lt;/h4&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;SELECT r.rolname,
       (SELECT unnest(s.setconfig) FROM pg_db_role_setting s WHERE s.setrole = r.oid AND s.setconfig::text LIKE &amp;#39;%statement_timeout%&amp;#39; LIMIT 1) AS statement_timeout
FROM pg_roles r
WHERE r.rolcanlogin
ORDER BY r.rolname;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;</description>
    </item>
    <item>
      <title>SQL Snippets</title>
      <link>https://www.hascode.com/sql-snippets/</link>
      <pubDate>Mon, 01 Mar 2010 00:00:00 +0100</pubDate>
      <guid>https://www.hascode.com/sql-snippets/</guid>
      <description>&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_count_unique_all_values&#34;&gt;Count unique / all values&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;SELECT COUNT(DISTINCT &amp;lt;FIELDNAME&amp;gt;), COUNT(ALL &amp;lt;FIELDNAME&amp;gt;) FROM &amp;lt;TABLE&amp;gt;;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_partially_anonymize_e_mail_addresses&#34;&gt;Partially anonymize e-mail addresses&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;UPDATE &amp;lt;TABLE_NAME&amp;gt;
SET &amp;lt;EMAIL_FIELD&amp;gt;=
INSERT(
&amp;lt;EMAIL_FIELD&amp;gt;,
POSITION(&amp;#39;@&amp;#39; IN &amp;lt;EMAIL_FIELD&amp;gt;),
100,
CONCAT(FLOOR(1 + (RAND() * 100)),&amp;#39;@hascode.com&amp;#39;))
WHERE
POSITION(&amp;#39;@&amp;#39; IN &amp;lt;EMAIL_FIELD&amp;gt;)&amp;gt;0;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_find_duplicate_entries&#34;&gt;Find duplicate entries&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;listingblock&#34;&gt;
&lt;div class=&#34;content&#34;&gt;
&lt;pre class=&#34;highlight&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;SELECT COUNT(*), &amp;lt;FIELDNAME&amp;gt; FROM &amp;lt;TABLENAME&amp;gt;
GROUP BY &amp;lt;FIELDNAME&amp;gt;
HAVING COUNT(*)&amp;gt;1;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&#34;sect1&#34;&gt;
&lt;h2 id=&#34;_mysql_fix_zero_dates_for_data_imports&#34;&gt;MySQL Fix Zero Dates for Data Imports&lt;/h2&gt;
&lt;div class=&#34;sectionbody&#34;&gt;
&lt;div class=&#34;quoteblock&#34;&gt;
&lt;blockquote&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;Error: ERROR 1067 (42000) at line 1234: Invalid default value for ‘datefield’&lt;/p&gt;
&lt;/div&gt;
&lt;/blockquote&gt;
&lt;/div&gt;
&lt;div class=&#34;paragraph&#34;&gt;
&lt;p&gt;In newer MySQL Versions zero in date or zero dates are forbidden .. check this with:&lt;/p&gt;
&lt;/div&gt;</description>
    </item>
  </channel>
</rss>
