Configure MySQL for Arduino in Python

less than 1 minute read


This guide is only applicable for Windows.

This article explains the steps associated with configuring MySQL for Arduino in Python.


  1. First install XAMPP/WAMP. Then open its control panel and start Apache and MySQL servers. After that, click the admin button and goto PHPMyAdmin and create the database to store the data.

  2. Install Python 2.7, and install pyserial, MYSQLdb libraries.

  3. Install pyserial, you can also download it from here Download the “.exe” file and just run it.

  4. Install MYSQLdb, you can also download it from Download the “.exe” file and just run it.

  5. Then, create the required python program to update the database. For this, you need to add two import import serial and import MysqlDb.

  6. Install Arduino and write the program to read values from the sensor and print the values using serial.Println(readData).

I referred to this code in 4 for my project; I hope this will help you.