Which arduino and parts should I buy?

I am a new user, if I want to use arduion to connect SQL database of my PC by wireless,Which arduino and parts should I buy?

(I have requested the moderators move this thread to Project Guidance)

There are many kinds of SQL databases. Can you be more specific? Do you have LAMP or WAMP installed on the pc? What else will the Arduino be doing? What data will it send to the database?

My recommendation at this point would be Wemos Mini. They are small, inexpensive, easy to use and has WiFi built in.

PaulRB:
(I have requested the moderators move this thread to Project Guidance)

There are many kinds of SQL databases. Can you be more specific? Do you have LAMP or WAMP installed on the pc? What else will the Arduino be doing? What data will it send to the database?

My recommendation at this point would be Wemos Mini. They are small, inexpensive, easy to use and has WiFi built in.

Thanks for your reply, I have not built any kind of SQL database now. Before I choose database, I want to know whether Arduino can write data to any kind database directly, rather than I need to build a app in my PC to write data to database. I will choose database after choosing Arduino.
Arduino will get temperature data from sensor, I hope it can write temperature data to database of my PC directly by wireless, so I need not to build a PC app to write data to database after Arduino sends data to PC.
Best regards.

Titus_Song:
I am a new user, if I want to use arduion to connect SQL database of my PC by wireless,Which arduino and parts should I buy?

You can use an Arduino UNO, an ESP8266-01 and I like the DHT-22 because it's just as inexpensive and a little more accurate (in theory)

Connecting to your database will be the challenge.

I only know how to do it via internet protocol (http) but there's ways to do it via Serial Im sure.
However, since you mentioned WiFi, you'll need a way for your PC to "serve" information to your WiFi module.

I set up a MySQL (because it's free) server on my PC and I use Coldfusion, but there are many other ways to do it.

You can also (Much more easily) connect to ThinkSpeak and send your data there where you can view it in graphs or download the RAW data for use on your PC etc.

Also, you don't HAVE to write data to a database unless you want to.

Because you can write data to a Data Logger that interfaces with the Arduino and can write the data to an SD card. Then you could pop the SD card out and upload the data into a spreadsheet for example.

Titus_Song:
I want to know whether Arduino can write data to any kind database directly, rather than I need to build a app in my PC to write data to database.

An Arduino cannot write directly to any file on a PC. There must be a program running on the PC to receive the data from the Arduino and save it to the file. Whether it is saving it to a file for an SQL database or any other sort of file, there still needs to be a PC program.

...R

If you install LAMP/WAMP on your PC, this includes the MySQL database. There is an Arduino library that can connect directly to a MySQL database and store data into the database (the "M" in LAMP stands for MySQL). Alternatively, the Arduino can send an http GET or POST request to the PC. A short PHP script on the PC can receive these requests and perform the database update (the "P" in LAMP stands for PHP, which is a scripting language).

PaulRB:
There is an Arduino library that can connect directly to a MySQL database and store data into the database

Does it use WiFi or a serial connection, perhaps using Bluetooth?

...R

Robin2:
Does it use WiFi or a serial connection, perhaps using Bluetooth?

WiFi, yes. Serial/bluetooth... perhaps, I don't know.

(Being pedantic, WiFi is also a type of serial connection. The bits are sent at high speed, but they are still sent one-at-a-time!)

PaulRB:
(Being pedantic, WiFi is also a type of serial connection. The bits are sent at high speed, but they are still sent one-at-a-time!)

I’m not sure that pedantry helps the OP.

To be honest, saying that it uses WiFi is not a lot of help either. How about giving the OP a link to the documentation for the system that you have in mind.

…R

For the processor: ESP8266. Look into the NodeMCU and WeMOS development boards, very convenient. Work great with the Arduino IDE.

That takes care of reading the DHT22 and the WiFi.

Then you install the MySQL connector library, and you can talk directly to a MySQL database on your PC over the Internet (that MySQL server can be anywhere; my systems at home talk to my external cloud server just fine).

PaulRB:
(the "P" in LAMP stands for PHP, which is a scripting language).

Or Python, in my case (with the mod_python module to connect it to Apache). I don't speak PHP, and what I've seen of it, it makes web pages an intangible mess.

PaulRB:
If you install LAMP/WAMP on your PC, this includes the MySQL database. There is an Arduino library that can connect directly to a MySQL database and store data into the database (the "M" in LAMP stands for MySQL).).

About the Arduino library that can connect directly to a MySQL database, How can I get it?
In fact, i just got a old Arduino mega 2560 from my friend to study first step, I do not know what more should buy and download for my project .

Titus_Song:
About the Arduino library that can connect directly to a MySQL database, How can I get it?

I gave you the name already.... as your Google-fu (or reading) skills appear lacking, hereby the link. Just install this: https://github.com/ChuckBell/MySQL_Connector_Arduino

Another option is to connect the Arduino to the PC using a serial link over Bluetooth and a Python program on the PC using the Python peewee library to access the SQL database. If you don't have any particular prefernces the SQLite database is very easy to implement.

...R

wvmarle:
I gave you the name already.... as your Google-fu (or reading) skills appear lacking, hereby the link. Just install this: https://github.com/ChuckBell/MySQL_Connector_Arduino

Thank you for your shaing, I am going to study first step of my project!

wvmarle:
I gave you the name already… as your Google-fu (or reading) skills appear lacking, hereby the link. Just install this: GitHub - ChuckBell/MySQL_Connector_Arduino: Database connector library for using MySQL with your Arduino projects.

Sorry to trouble you again, I have difficult problems about “MySQL_Connector_Arduino”.
I try to verfy/compile the two examples from it :

  1. Connect MySQL by Ethernet: the Error compiling is about “SPI”, so I add “#include <SPI.h>”, it is ok.
  2. Connect MySQL by Wifi: a lot of Error compiling such as “MySQL_Packet.h:51: error: ISO C++ forbids declaration of ‘Client’ with no type”,
    so I download new wifi lib from github.com, Error compiling became about “SPI” like by Ethernet. When I add “#include <SPI.h>” again, old Error compiling came back such as “MySQL_Packet.h:51: error: ISO C++ forbids declaration of ‘Client’ with no type”
    I donot know how to solve it.
    Error compiling is bellow.

Error Compiling.txt (2.24 KB)