René's URL Explorer Experiment


Title: Arduino unable to connect to database · Issue #237 · ChuckBell/MySQL_Connector_Arduino · GitHub

Open Graph Title: Arduino unable to connect to database · Issue #237 · ChuckBell/MySQL_Connector_Arduino

X Title: Arduino unable to connect to database · Issue #237 · ChuckBell/MySQL_Connector_Arduino

Description: As recommended in the wiki documentation, I tested that I can connect to the database from a different system: paul@paul-desktop:~$ sudo mysql -h192.168.1.201 -ugranary_sensors -ppassword --port=3306 Welcome to the MariaDB monitor. Comma...

Open Graph Description: As recommended in the wiki documentation, I tested that I can connect to the database from a different system: paul@paul-desktop:~$ sudo mysql -h192.168.1.201 -ugranary_sensors -ppassword --port=33...

X Description: As recommended in the wiki documentation, I tested that I can connect to the database from a different system: paul@paul-desktop:~$ sudo mysql -h192.168.1.201 -ugranary_sensors -ppassword --port=33...

Opengraph URL: https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Arduino unable to connect to database","articleBody":"As recommended in the wiki documentation, I tested that I can connect to the database from a different system:\r\n```\r\npaul@paul-desktop:~$ sudo mysql -h192.168.1.201 -ugranary_sensors -ppassword  --port=3306\r\nWelcome to the MariaDB monitor.  Commands end with ; or \\g.\r\nYour MariaDB connection id is 122\r\nServer version: 10.11.5-MariaDB-log Alpine Linux\r\n\r\nCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.\r\n\r\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\r\n\r\nMariaDB [(none)]> select * from granary_sensors.granary_sensors\r\n    -> ;\r\nERROR 1142 (42000): SELECT command denied to user 'granary_sensors'@'paul-desktop.lan' for table `granary_sensors`.`granary_sensors`\r\nMariaDB [(none)]> insert into granary_sensors.granary_sensors (sensor_name, sensor_value) values ('tt', -999);\r\nQuery OK, 1 row affected (0.001 sec)\r\n\r\nMariaDB [(none)]> exit\r\nBye\r\n```\r\nThe above is as expected. I have granted permission to the user granary_sensors to insert records into only that one table, and nothing else. That is why the select command fails but the insert command succeeds. So far, great.\r\n\r\nNext, I took the example sketch from this library, amended it with my desired details and uploaded it to a Wemos D1 Mini Pro (an ESP8266 board):\r\n\r\n```\r\n/*\r\n  MySQL Connector/Arduino Example : connect by wifi\r\n\r\n  This example demonstrates how to connect to a MySQL server from an\r\n  Arduino using an Arduino-compatible Wifi shield. Note that \"compatible\"\r\n  means it must conform to the Ethernet class library or be a derivative\r\n  with the same classes and methods.\r\n  \r\n  For more information and documentation, visit the wiki:\r\n  https://github.com/ChuckBell/MySQL_Connector_Arduino/wiki.\r\n\r\n  INSTRUCTIONS FOR USE\r\n\r\n  1) Change the address of the server to the IP address of the MySQL server\r\n  2) Change the user and password to a valid MySQL user and password\r\n  3) Change the SSID and pass to match your WiFi network\r\n  4) Connect a USB cable to your Arduino\r\n  5) Select the correct board and port\r\n  6) Compile and upload the sketch to your Arduino\r\n  7) Once uploaded, open Serial Monitor (use 115200 speed) and observe\r\n\r\n  If you do not see messages indicating you have a connection, refer to the\r\n  manual for troubleshooting tips. The most common issues are the server is\r\n  not accessible from the network or the user name and password is incorrect.\r\n\r\n  Created by: Dr. Charles A. Bell\r\n*/\r\n#include \u003cESP8266WiFi.h>           // Use this for WiFi instead of Ethernet.h\r\n#include \u003cMySQL_Connection.h>\r\n#include \u003cMySQL_Cursor.h>\r\n\r\nIPAddress server_addr(192,168,1,201);  // IP of the MySQL *server* here\r\nchar user[] = \"granary_sensors\";              // MySQL user login username\r\nchar password[] = \"password\";        // MySQL user login password\r\n\r\n// Sample query\r\nchar INSERT_SQL[] = \"INSERT INTO granary_sensors.granary_sensors (sensor_name, sensor_value) VALUES ('TT', -999)\";\r\n\r\n// WiFi card example\r\nchar ssid[] = \"granary\";         // your SSID\r\nchar pass[] = \"password\";     // your SSID Password\r\n\r\nWiFiClient client;                 // Use this for WiFi instead of EthernetClient\r\nMySQL_Connection conn(&client);\r\nMySQL_Cursor* cursor;\r\n\r\nvoid setup()\r\n{\r\n  Serial.begin(115200);\r\n  while (!Serial); // wait for serial port to connect. Needed for Leonardo only\r\n\r\n  // Begin WiFi section\r\n  Serial.printf(\"\\nConnecting to %s\", ssid);\r\n  WiFi.begin(ssid, pass);\r\n  while (WiFi.status() != WL_CONNECTED) {\r\n    delay(500);\r\n    Serial.print(\".\");\r\n  }\r\n\r\n  // print out info about the connection:\r\n  Serial.println(\"\\nConnected to network\");\r\n  Serial.print(\"My IP address is: \");\r\n  Serial.println(WiFi.localIP());\r\n\r\n  Serial.print(\"Connecting to SQL...  \");\r\n  if (conn.connect(server_addr, 3306, user, password))\r\n    Serial.println(\"OK.\");\r\n  else\r\n    Serial.println(\"FAILED.\");\r\n  \r\n  // create MySQL cursor object\r\n  cursor = new MySQL_Cursor(&conn);\r\n}\r\n\r\nvoid loop()\r\n{\r\n  if (conn.connected())\r\n    cursor->execute(INSERT_SQL);\r\n\r\n  delay(5000);\r\n}\r\n```\r\n\r\nI get the following error in Serial Monitor:\r\n```\r\n14:34:55.908 -> ..............\r\n14:35:03.128 -> Connected to network\r\n14:35:03.128 -> My IP address is: 192.168.1.76\r\n14:35:03.128 -> Connecting to SQL...  ...trying...\r\n14:35:03.460 -> Error: 88 = Access denied for user 'granary_sensors'@'ESP-D091A2.lan' (using password: YES).\r\n14:35:03.460 -> FAILED.\r\n```\r\n\r\nCan anyone please help me spot my error, or suggest next steps to diagnose?\r\n\r\nArduino IDE: 1.8.19\r\nMySQL_Connector_Arduino library version installed: 1.2.0\r\nESP8266 board core version: 3.1.2\r\n\r\nPermissions for the granary_sensors user:\r\n\r\n```\r\npaul@paul-desktop:~$ mysql -uroot -ppassword -h192.168.1.201 --port=3306\r\nWelcome to the MariaDB monitor.  Commands end with ; or \\g.\r\nYour MariaDB connection id is 150\r\nServer version: 10.11.5-MariaDB-log Alpine Linux\r\n\r\nCopyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.\r\n\r\nType 'help;' or '\\h' for help. Type '\\c' to clear the current input statement.\r\n\r\nMariaDB [(none)]> SHOW GRANTS FOR granary_sensors;\r\n+----------------------------------------------------------------------------------------------------------------+\r\n| Grants for granary_sensors@%                                                                                   |\r\n+----------------------------------------------------------------------------------------------------------------+\r\n| GRANT USAGE ON *.* TO `granary_sensors`@`%` IDENTIFIED BY PASSWORD '*733B51F92EB06BE45A3761D5B53B881709A82C03' |\r\n| GRANT INSERT ON `granary_sensors`.`granary_sensors` TO `granary_sensors`@`%` WITH GRANT OPTION                 |\r\n+----------------------------------------------------------------------------------------------------------------+\r\n2 rows in set (0.001 sec)\r\n\r\n```","author":{"url":"https://github.com/PaulRB","@type":"Person","name":"PaulRB"},"datePublished":"2024-09-01T15:45:33Z","url":"https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:c0b3b14c-d8da-04f3-7256-968e242fac51
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA31E:3AC034:5B9A5A:7B777A:6B003411
html-safe-noncec291965d855a3e0043fe837aa9142a3a93ea844135aac63aec1c8cecdeb60c69
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMzFFOjNBQzAzNDo1QjlBNUE6N0I3NzdBOjZCMDAzNDExIiwidmlzaXRvcl9pZCI6IjU0MDYzNDY2NjY1MTEwNDI3MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac9445d853dff4f2a48deb13b95af3c4068fdea0cae051d2e40541e967d87221e1
hovercard-subject-tagissue:2499548427
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/ChuckBell/MySQL_Connector_Arduino/237/issue_layout
twitter:imagehttps://opengraph.githubassets.com/ca918ba1a4debdfd06de658c011a090ca6e7c38e2597f649b39f95943647907c/ChuckBell/MySQL_Connector_Arduino/issues/237
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/ca918ba1a4debdfd06de658c011a090ca6e7c38e2597f649b39f95943647907c/ChuckBell/MySQL_Connector_Arduino/issues/237
og:image:altAs recommended in the wiki documentation, I tested that I can connect to the database from a different system: paul@paul-desktop:~$ sudo mysql -h192.168.1.201 -ugranary_sensors -ppassword --port=33...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamePaulRB
hostnamegithub.com
expected-hostnamegithub.com
None7d0829bbde9e48b2486cb5dd6d147896eb01d32134627091f818958a935ef3f0
turbo-cache-controlno-preview
go-importgithub.com/ChuckBell/MySQL_Connector_Arduino git https://github.com/ChuckBell/MySQL_Connector_Arduino.git
octolytics-dimension-user_id8201184
octolytics-dimension-user_loginChuckBell
octolytics-dimension-repository_id49725805
octolytics-dimension-repository_nwoChuckBell/MySQL_Connector_Arduino
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id49725805
octolytics-dimension-repository_network_root_nwoChuckBell/MySQL_Connector_Arduino
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasef3f3a43ca095cdea3abbb394112e971f9fdb94fa
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FChuckBell%2FMySQL_Connector_Arduino%2Fissues%2F237
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FChuckBell%2FMySQL_Connector_Arduino%2Fissues%2F237
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=ChuckBell%2FMySQL_Connector_Arduino
Reloadhttps://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237
Reloadhttps://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237
Reloadhttps://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237
ChuckBellhttps://github.com/ChuckBell
MySQL_Connector_Arduinohttps://github.com/ChuckBell/MySQL_Connector_Arduino
Codehttps://github.com/ChuckBell/MySQL_Connector_Arduino
Issues53 (53)https://github.com/ChuckBell/MySQL_Connector_Arduino/issues
Pull requests2 (2)https://github.com/ChuckBell/MySQL_Connector_Arduino/pulls
Actionshttps://github.com/ChuckBell/MySQL_Connector_Arduino/actions
Projectshttps://github.com/ChuckBell/MySQL_Connector_Arduino/projects
Wikihttps://github.com/ChuckBell/MySQL_Connector_Arduino/wiki
Security and qualityhttps://github.com/ChuckBell/MySQL_Connector_Arduino/security
Insightshttps://github.com/ChuckBell/MySQL_Connector_Arduino/pulse
https://github.com/ChuckBell/MySQL_Connector_Arduino
New issuehttps://github.com/login?return_to=https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237
New issuehttps://github.com/login?return_to=https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237
Arduino unable to connect to databasehttps://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237#top
https://github.com/PaulRB
PaulRBhttps://github.com/PaulRB
on Sep 1, 2024https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237#issue-2499548427
https://github.com/ChuckBell
ChuckBellhttps://github.com/ChuckBell
on Sep 6, 2024https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237#issuecomment-2334820244
…https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237
https://github.com/ChuckBell/MySQL_Connector_Arduino/wikihttps://github.com/ChuckBell/MySQL_Connector_Arduino/wiki
#237https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237
https://github.com/notifications/unsubscribe-auth/AB6SHYFGE22WGEFZ37ZVWQDZUMZDHAVCNFSM6AAAAABNO6HBKOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ4TSNJUHA2DENYhttps://github.com/notifications/unsubscribe-auth/AB6SHYFGE22WGEFZ37ZVWQDZUMZDHAVCNFSM6AAAAABNO6HBKOVHI2DSMVQWIX3LMV43ASLTON2WKOZSGQ4TSNJUHA2DENY
https://github.com/PaulRB
PaulRBhttps://github.com/PaulRB
on Sep 7, 2024https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237#issuecomment-2335777630
https://github.com/PaulRB
PaulRBhttps://github.com/PaulRB
on Sep 8, 2024https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237#issuecomment-2336635109
https://github.com/PaulRB
PaulRBhttps://github.com/PaulRB
on Sep 8, 2024https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237#issuecomment-2336636071
https://github.com/PaulRB
PaulRBhttps://github.com/PaulRB
on Sep 8, 2024https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237#issuecomment-2336686476
this page:https://dev.mysql.com/doc/refman/8.4/en/native-pluggable-authentication.html#native-pluggable-authentication-installation
https://github.com/ChuckBell
ChuckBellhttps://github.com/ChuckBell
on Sep 17, 2024https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237#issuecomment-2356194855
https://dev.mysql.com/doc/refman/8.4/en/native-pluggable-authentication.html#native-pluggable-authentication-installationhttps://dev.mysql.com/doc/refman/8.4/en/native-pluggable-authentication.html#native-pluggable-authentication-installation
…https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237
https://dev.mysql.com/doc/refman/8.4/en/native-pluggable-authentication.html#native-pluggable-authentication-installationhttps://dev.mysql.com/doc/refman/8.4/en/native-pluggable-authentication.html#native-pluggable-authentication-installation
#237 (comment)https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237#issuecomment-2336686476
https://github.com/notifications/unsubscribe-auth/AB6SHYBXBJIG23CSWA2JG6DZVRGDVAVCNFSM6AAAAABNO6HBKOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZWGY4DMNBXGYhttps://github.com/notifications/unsubscribe-auth/AB6SHYBXBJIG23CSWA2JG6DZVRGDVAVCNFSM6AAAAABNO6HBKOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZWGY4DMNBXGY
https://github.com/PaulRB
PaulRBhttps://github.com/PaulRB
on Sep 17, 2024https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237#issuecomment-2356625151
https://github.com/EK76
EK76https://github.com/EK76
on Oct 31, 2025https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237#issuecomment-3474986053
https://github.com/ChuckBell
ChuckBellhttps://github.com/ChuckBell
on Oct 31, 2025https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237#issuecomment-3474993689
…https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237
ChuckBell/MySQL_Connector_Arduino#237https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237
#237 (comment)https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237#issuecomment-3474986053
#237 (comment)https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237#issuecomment-3474986053
https://github.com/notifications/unsubscribe-auth/AB6SHYAHO3CJKXJK4JKNTTL32PKDBAVCNFSM6AAAAACK2DX5GCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTINZUHE4DMMBVGMhttps://github.com/notifications/unsubscribe-auth/AB6SHYAHO3CJKXJK4JKNTTL32PKDBAVCNFSM6AAAAACK2DX5GCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTINZUHE4DMMBVGM
https://github.com/EK76
EK76https://github.com/EK76
on Oct 31, 2025https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237#issuecomment-3475003055
Sign up for freehttps://github.com/signup?return_to=https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237
Sign in to commenthttps://github.com/login?return_to=https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/237
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.