<html>
<head>
    <base href="https://docs.jboss.org/author">
            <link rel="stylesheet" href="/author/s/en/2172/19/5/_/styles/combined.css?spaceKey=TEIID&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://docs.jboss.org/author/display/TEIID/MySQL+Translators">MySQL Translators</a></h2>
    <h4>Page  <b>added</b> by             <a href="https://docs.jboss.org/author/display/~van.halbert">Van Halbert</a>
    </h4>
         <br/>
    <div class="notificationGreySide">
         <h1><a name="MySQLTranslators-MySQLTranslator%28mysql%2Fmysql5%29"></a><b>MySQL Translator</b> (mysql/mysql5)</h1>

<p>The MySQL translation is supported by 2 translators.</p>

<h3><a name="MySQLTranslators-mysql"></a><em>mysql</em></h3>

<p>The Mysql translator, known by the name of <b><em>mysql</em></b>, is for use with MySQL version 4.x.</p>


<h3><a name="MySQLTranslators-mysql5"></a><em>mysql5</em></h3>

<p>The Mysql5 translator, known by the name of <b><em>mysql5</em></b>, is for use with MySQL version 5 or later.</p>

<p>Also backwards compatible MySQL derivatives, including MariaDB.</p>


<h3><a name="MySQLTranslators-Usage"></a>Usage</h3>

<p>The MySQL Translators expect the database or session to be using ANSI mode. If the database is not using ANSI mode, an initialization query should be used on the pool to set ANSI mode:</p>
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">set SESSION sql_mode = 'ANSI'</pre>
</div></div>

<p>If you may deal with null timestamp values, then set the connection property zeroDateTimeBehavior=convertToNull.  Otherwise you'll get conversion errors in Teiid that '0000-00-00 00:00:00' cannot be converted to a timestamp.</p>
    </div>
    <div id="commentsSection" class="wiki-content pageSection">
       <div style="float: right;" class="grey">
                        <a href="https://docs.jboss.org/author/users/removespacenotification.action?spaceKey=TEIID">Stop watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://docs.jboss.org/author/users/editmyemailsettings.action">Change email notification preferences</a>
</div>
       <a href="https://docs.jboss.org/author/display/TEIID/MySQL+Translators">View Online</a>
              |
       <a href="https://docs.jboss.org/author/display/TEIID/MySQL+Translators?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
           </div>
</div>
</div>
</div>
</div>
</body>
</html>