MySQL for the Internet of Things

(Steven Felgate) #1

Chapter 6 ■ Building low-Cost MysQl data nodes


Installing MySQL


The MySQL installation on BeagleBone Black is similar to the Raspberry Pi example earlier except the
commands are a little different but we execute them in the same order. The following shows the commands you
execute. We must first update the local packages and package headers. Use the following command to do this:


$ opkg update


Next, we install MySQL with the following command:

$ opkg install mysql5


This process will take a while beginning with downloading a number of packages and supporting
libraries. Once the installation is complete, issue the following command to launch MySQL:


$ /etc/init.d/mysqld start


Depending on the date of your BeagleBone Black’s preinstalled operating system, you may see an error
similar to the following:


/etc/init.d/mysqld: line 3: /etc/default/rcS: No such file or directory
BeagleBone - mysqld error.png


The problem is an error in the script that starts MySQL. We edit the file with the following command
and comment out the third line in the file (more specifically, the line that reads /etc/default/rcS). Just put
a # in the first column to comment it out.


$ vi /etc/init.d/mysqld


Save the file and then restart MySQL as follows:

$ /etc/init.d/mysqld start


■Note there is no sudo on the BeagleBone Black default installation. to shut down, simply use the shutdown


–h now command.


Configuring the Hard Drive


Configuring the hard drive on the BeagleBone Black uses the same commands as those on the Raspberry Pi.
That is, you use fdisk to create a partition and mkfs to create the file system.


pcDuino


The pcDuino is a unique board. The newest versions support the A20 or later processors (multicore and
a bit faster than other boards). The board also has many connectors including an onboard SATA port for
supporting a SATA hard drive. Perhaps the most interesting and indeed the reason for the name are the
board supports Arduino-compatible shields. As you saw in Chapter 3 , this allows us to develop our Arduino
solutions on a single device.

Free download pdf