# Error in connection with mariadb

**URL:** <https://discourse.nodered.org/t/error-in-connection-with-mariadb/24273>\
**Category:** General\
**Created:** [5 April 2020 14:19 UTC](https://discourse.nodered.org/t/error-in-connection-with-mariadb/24273 "2020-04-05T14:19:33Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![phil1](https://avatars.discourse-cdn.com/v4/letter/p/848f3c/32.png) [@phil1](https://discourse.nodered.org/u/phil1)\
**Post date:** [5 April 2020 14:19 UTC](https://discourse.nodered.org/t/error-in-connection-with-mariadb/24273/1 "2020-04-05T14:19:33Z")

</div>

Hello,

I am trying in a simple projet (like a beginner...) to connect node-red to a database with mariadb (under raspberry pi)  
I have already create the base under Mariadb and i can access it sous mariadb (root + Password).  
But i can't do it under node red (node-red-node-mysql is istalled ...)  
I receive this message in debug : Error: Packets out of order. Got: 1 Expected: 0"

 ![phot1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/0/d054a420b31c6fef3b30e55a711930d349e0ea40.png)  
 ![phot2](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/4/a4b98ada828d206e7c984d66423eed0eeb14bdbc.png)

Annyone have an idea ?  
Thank !

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [5 April 2020 14:30 UTC](https://discourse.nodered.org/t/error-in-connection-with-mariadb/24273/2 "2020-04-05T14:30:27Z")

</div>

which version of the node-red-node-mysql are you using ?  
that sort of error usually indicates the server either not being there or disconnecting rapidly for some reason. Can you connect to it from another client (not command line ?)

---

<div class="post-metadata">

**Author:** ![phil1](https://avatars.discourse-cdn.com/v4/letter/p/848f3c/32.png) [@phil1](https://discourse.nodered.org/u/phil1)\
**Post date:** [5 April 2020 14:47 UTC](https://discourse.nodered.org/t/error-in-connection-with-mariadb/24273/3 "2020-04-05T14:47:52Z")

</div>

Thanks for your prompt response !  
The version is : 0.0.20  
I Have not tried any other client : what advise you to test ?

---

<div class="post-metadata">

**Author:** ![phil1](https://avatars.discourse-cdn.com/v4/letter/p/848f3c/32.png) [@phil1](https://discourse.nodered.org/u/phil1)\
**Post date:** [5 April 2020 21:50 UTC](https://discourse.nodered.org/t/error-in-connection-with-mariadb/24273/4 "2020-04-05T21:50:59Z")

</div>

I tried reinstalling my raspberry  
Starting with phpmyadmin (avec apache2 et php 7), then node-red and its libraries: everything works perfectly!  
But if I install behind raspap (I need a wifi access point): the problem comes back ...  
Is there a conflict with raspap?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [5 April 2020 22:02 UTC](https://discourse.nodered.org/t/error-in-connection-with-mariadb/24273/5 "2020-04-05T22:02:36Z")

</div>

I wouldn't think there is a conflict - but more likely the security on mysql is blocking access to remote clients - so you need to configure it correctly to allow remote access - there are plenty of mysql guides to help that.

---

<div class="post-metadata">

**Author:** ![phil1](https://avatars.discourse-cdn.com/v4/letter/p/848f3c/32.png) [@phil1](https://discourse.nodered.org/u/phil1)\
**Post date:** [6 April 2020 19:51 UTC](https://discourse.nodered.org/t/error-in-connection-with-mariadb/24273/6 "2020-04-06T19:51:09Z")

</div>

Thank you for this track that I will explore  
But I don't really believe in it: raspap is used for the connection with the MQTT server and the arduino card and not between node-red and the mysql server (which is exclusively local)  
In addition, this problem appears only after installing raspap ...  
But it is worth trying!

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [6 April 2020 21:02 UTC](https://discourse.nodered.org/t/error-in-connection-with-mariadb/24273/7 "2020-04-06T21:02:16Z")

</div>

Possibly this, though I don't see the connection with raspap

> <https://stackoverflow.com/questions/46140902/protocol-packets-out-of-order>

---

<div class="post-metadata">

**Author:** ![phil1](https://avatars.discourse-cdn.com/v4/letter/p/848f3c/32.png) [@phil1](https://discourse.nodered.org/u/phil1)\
**Post date:** [8 April 2020 10:50 UTC](https://discourse.nodered.org/t/error-in-connection-with-mariadb/24273/8 "2020-04-08T10:50:13Z")

</div>

You were right: it is a problem of access rights with mariadb users!  
This problem is caused by the installation of raspap: the database is no longer considered in localhost; however I do not use the access point to connect to it ...  
For the moment I therefore declare the base on the IP address of eth0 and I give rights accordingly. But I don't find it practical or flexible. There must be a simpler solution.  
Thank you very much for your wise advice!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [22 April 2020 10:50 UTC](https://discourse.nodered.org/t/error-in-connection-with-mariadb/24273/9 "2020-04-22T10:50:16Z")

</div>

Closed on 22 April 2020 10:50 UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
