ChuckBell / MySQL_Connector_Arduino

Database connector library for using MySQL with your Arduino projects.
332 stars 133 forks source link

Error: 29 = No database selected. #74

Closed seaburngames closed 2 years ago

seaburngames commented 5 years ago

Hi I'm connecting to the server but unable to select my database...
Probably similar as issue #61

85.233.********
Connecting...
Connected to server version 5.5.60-log

Running SELECT and printing results

Error: 29 = No database selected
ChuckBell commented 5 years ago

You need to specify the database in the select. For example: SELECT * FROM mudbank.mytbl ...

On Wed, Nov 14, 2018 at 07:32 seaburngames notifications@github.com wrote:

Hi I'm connecting to the server but unable to select my database... Probably similar as issue #61 https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/61

85.233.**** Connecting... Connected to server version 5.5.60-log

Running SELECT and printing results

Error: 29 = No database selected

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/74, or mute the thread https://github.com/notifications/unsubscribe-auth/AH0j4CAJTtT5T9_m1Mzk42yfyt0cvfeOks5uvA1WgaJpZM4Ydpjt .

seaburngames commented 5 years ago

im using this char query[] = "SELECT * FROM RunningPrintJobs;";

ChuckBell commented 5 years ago

So, add the database. :)

Mydbnamegoeshere.RunningPrintJobs

On Wed, Nov 14, 2018 at 09:46 seaburngames notifications@github.com wrote:

im using this char query[] = "SELECT * FROM RunningPrintJobs;";

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/74#issuecomment-438686575, or mute the thread https://github.com/notifications/unsubscribe-auth/AH0j4AkL7ACRmrwTTqitFB63eOKtq9oqks5uvCzWgaJpZM4Ydpjt .

seaburngames commented 5 years ago

right so i added this :

char query[] = "USE PH123048_printtracker; SELECT * FROM RunningPrintJobs";

getting this


Connecting...
Connected to server version 5.5.60-log

Running SELECT and printing results

Disconnected.
ChuckBell commented 5 years ago

No, don’t use the use clause. You must add the dB name as I’ve suggested.

SELECT * FROM PH123048_printtracker.RunningPrintJobs

You cannot combine queries.

On Wed, Nov 14, 2018 at 10:00 seaburngames notifications@github.com wrote:

right so i added this :

char query[] = "USE PH123048_printtracker; SELECT * FROM RunningPrintJobs";

getting this

Connecting... Connected to server version 5.5.60-log

Running SELECT and printing results

Disconnected.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/74#issuecomment-438691671, or mute the thread https://github.com/notifications/unsubscribe-auth/AH0j4A1kBE5uM49QjTzwe0NXW4fbrDEdks5uvDABgaJpZM4Ydpjt .

seaburngames commented 5 years ago

im sorry brains not working today, that removed the db error now im getting a

Memory error

ChuckBell commented 5 years ago

Are you following the example sketch to read the columns and rows?

If you can’t figure it out, you can send me your sketch and I’ll look at it when I get some time to tinker.

On Wed, Nov 14, 2018 at 10:10 seaburngames notifications@github.com wrote:

im sorry brains not working today, that removed the db error now im getting a

Memory error

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/74#issuecomment-438695448, or mute the thread https://github.com/notifications/unsubscribe-auth/AH0j4K9HtfRxUI5WOtEc2pzbCjIRns7mks5uvDJngaJpZM4Ydpjt .

ChuckBell commented 5 years ago

I tested your sketch. The only thing I changed was I used IP to connect since DNS doesn't work reliably on my mobile network. And I changed the query to SELECT from world.city ... limit 10. Worked fine. I am also using MySQL 8.0.13.

Try again using IP to connect. If that doesn't work, try a newer version of MySQL.

What board are you using?

ChuckBell commented 5 years ago

I have a patch ready to test. Would you like to try it out? If so, please PM me at d r c h a r l e s b e l l at g m a i l dot c o m. I'll send you a .diff which you can apply to the latest code in github (may not apply to the one from library manager).

Bolukan commented 5 years ago

Surely,

If you include ESP32 I can test that too. Otherwise I start with ESP8266

if defined(ESP8266) || defined(ESP32)

include

include

else

include

endif

From: Dr. Charles Bell [mailto:notifications@github.com]

I have a patch ready to test. Would you like to try it out? If so, please PM me at d r c h a r l e s b e l l at g m a i l dot c o m. I'll send you a .diff which you can apply to the latest code in github (may not apply to the one from library manager).