-
Notifications
You must be signed in to change notification settings - Fork 134
Quick Start
To start using Connector/Arduino (hence connector or library), you must first have the Arduino IDE installed along with the correct drivers (if required) to access your Arduino board.
To install the connector, open the Arduino IDE and select Sketch | Include Library | Manager Libraries... and wait until the manger finishes loading. Then, type MySQL
in the search box and click Install to install the latest version of the connector. The following shows an example of what you should see in the Library Manager.
You also need access to a MySQL server running on your local network or accessible from your local network (watch out for firewalls!). In addition, you need to create a user account on the MySQL server for your Arduino. Since most will be using a local MySQL server, it is fine to use an account that is not tied to a specific host. Savvy MySQL users will want to improve that if you plan to use a MySQL server on the Internet.
To create a user account that has access to the database(s) you want to use from your Arduino, issue the following commands. Substitute a user name and password of your choice. Also, be sure to list the databases that you want to grant access.
CREATE USER 'arduino_user'@'%' IDENTIFIED WITH mysql_native_password BY 'secret';
GRANT ALL ON <comma separated list of databases> TO 'arduino_user';
Notice the use of mysql_native_password
in the IDENTIFIED WITH
clause. This is for the latest versions of MySQL that support newer authentication protocols (the default has changed). If you are using a (much) older version, you may not need this clause.