<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to MySQL problem with connection</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3f2d5608a1/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3f2d5608a1/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Engineering/thread/3f2d5608a1/</id><updated>2025-03-27T02:49:38.207000Z</updated><subtitle>Recent posts to MySQL problem with connection</subtitle><entry><title>MySQL problem with connection</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3f2d5608a1/?limit=25#c077" rel="alternate"/><published>2025-03-27T02:49:38.207000Z</published><updated>2025-03-27T02:49:38.207000Z</updated><author><name>warrumungi</name><uri>https://forge.codesys.com/u/warrumungi/</uri></author><id>https://forge.codesys.com61536defe43344570d2fbde028e9db64be9c2afd</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;5 years later: &lt;/p&gt;
&lt;p&gt;I'm also having the exact same problem!&lt;/p&gt;
&lt;p&gt;MySQL Workbench works fine across the LAN, but the codesys library cannot get past this stage...&lt;/p&gt;
&lt;p&gt;The library authors are not responding on their support email :(&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>MySQL problem with connection</title><link href="https://forge.codesys.com/forge/talk/Engineering/thread/3f2d5608a1/?limit=25#4c40" rel="alternate"/><published>2020-11-18T08:31:28.119000Z</published><updated>2020-11-18T08:31:28.119000Z</updated><author><name>pavel-entry</name><uri>https://forge.codesys.com/u/pavel-entry/</uri></author><id>https://forge.codesys.comee0183740a4226529effea5245396a8f41349bea</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I am using Codesys V3.5 SP16 and Codesys Control for Raspberry PI version 3.5.16.20&lt;br/&gt;
I would like to connect to my mySQL database. When I try to connect from raspberry pi using python, the connection works fine. But if I want to connect to mysql in codesys using the following library:&lt;br/&gt;
&lt;a href="https://store.codesys.com/mysql-library-sl.html?___store=en#1" rel="nofollow"&gt;https://store.codesys.com/mysql-library-sl.html?___store=en#1&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I can't connect.&lt;/p&gt;
&lt;p&gt;Code is following:&lt;br/&gt;
VAR&lt;br/&gt;
   _sHost:STRING:='192.168.0.1';&lt;br/&gt;
   _uiPort:UINT:=3306;&lt;br/&gt;
   _sDatabase:STRING:='database';&lt;br/&gt;
   _sUsername:STRING:='user';&lt;br/&gt;
   _sPassword:STRING:='password';&lt;br/&gt;
   xDoOpen:BOOL;&lt;br/&gt;
   _xConnectionState:BOOL;&lt;br/&gt;
   MySQL_ConnString:MySQL.MySQL_ConnectionString;&lt;br/&gt;
   MySQL_Open:MySQL.MySQL_Open;&lt;br/&gt;
   _Error_name:MySQL.ERROR;&lt;br/&gt;
   _State:STRING;&lt;br/&gt;
END_VAR&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;    &lt;span class="nt"&gt;xDoOpen&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;TRUE&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
    &lt;span class="nt"&gt;MySQL_Open&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;
        &lt;span class="nt"&gt;sHost&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;_sHost&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
        &lt;span class="nt"&gt;uiPort&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;_uiPort&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
        &lt;span class="nt"&gt;sDatabase&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;_sDatabase&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
        &lt;span class="nt"&gt;sUsername&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;_sUsername&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
        &lt;span class="nt"&gt;sPassword&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;_sPassword&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
        &lt;span class="nt"&gt;xStart&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;xDoOpen&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
        &lt;span class="nt"&gt;MySQL_Connection&lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="nt"&gt;MySQL_ConnString&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
        &lt;span class="nt"&gt;sExeute_State&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;_State&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
        &lt;span class="nt"&gt;eError&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;_Error_name&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt;
        &lt;span class="nt"&gt;xConnected&lt;/span&gt;&lt;span class="o"&gt;=&amp;gt;&lt;/span&gt;&lt;span class="nt"&gt;_xConnectionState&lt;/span&gt;
    &lt;span class="o"&gt;);&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;Once started, the _State variable is in the "Connection ok - waiting for HS" state. After a few seconds, it jumps to the "Error" state.&lt;/p&gt;
&lt;p&gt;Can you please advise me where the problem might be?&lt;br/&gt;
Thank you!&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>