How to configure the world's smallest MySQL server _mysql

Source: Internet
Author: User
Tags benchmark mysql in mysql query percona percona server yocto

Configure the world's smallest MySQL server-how to install a MySQL server for the dashboard on an Intel Edison.

Introduced

In one of my recent posts, the Internet of Things, news and MySQL, I showed you if particle Photon's board starts building your own Internet of things. The implementation is great, but because the particle Photon board does not have any local storage, there is a need for a stable internet (Wi-Fi) access. If you don't have a reliable network access (for example, in some remote location) or need something very small to store your data, you can now use Intel Edison. I even installed MySQL in Edison, which made it the smallest MySQL server in the world! Other options include the following:

Raspberry Pi (my college classmate installed the Percona server on Raspberry Pi)

Android based systems (e.g. Nexus 7:vadim installed Percona server on Nexus 7)

MySQL Configuration

Intel Edison is a compact computer, Silvermont dual-core Intel Atom CPU based on nm, 500MHz, running Linux (called Yocto based on Ubuntu release). In order to program Edison, we need an interface board. The optional boards include a compatible Arduino interface board (including an SD card) and an Intel interface board.

Installation and configuration are intuitive. I used the guide to open the Yocto project on the Intel Edison Board to install and configure the board. First we need to connect the Edison through the serial port, and configure the sshd and Wi-Fi, we can use SSH to connect to the Edison after the completion.

Because Linux's common binaries are compatible with Yocto Linux (so you don't need to compile anything), MySQL is relatively simple to install. There are two pits:

Yocto Linux (and the official repository) default does not contain the libraries required by MySQL: Libaio1, Libcrypto, Libssl

Internal storage is relatively small, and MySQL 5.7 binaries are not suitable for any partitions. I have to remove some "tests" and other things that I don't need. You can use the SD card (SD Sussu on some boards) when you really install it.

To install the library files, I followed this excellent guide: Edison package repo configuration, using the unofficial Edison repository. The settings are simple:

To configure your Edison to get the package from this repo, replace the items in the/etc/opkg/base-feeds.conf with the following items (other opkg profiles do not need to be changed):

src/gzallhttp://repo.opkg.net/edison/repo/allsrc/gzedisonhttp://repo.opkg.net/edison/repo/edisonsrc/ Gzcore2-32http://repo.opkg.net/edison/repo/core2-32[/code]

Then we need to install the library:

#opkginstalllibaio1_0.3libcrypto1.0.0libssl1.0.0[/code]

Finally we can download Percona Server 5.6 and place it somewhere (using Basedir in my.cnf to point to the installation path):

#wgethttps://www.percona.com/downloads/percona-server-5.6/percona-server-5.6.25-73.1/binary/tarball/ Percona-server-5.6.25-rel73.1-linux.i686.ssl100.tar.gz[/code]

Note that the latest Percona Server 5.6 is dependent on the Numa library, and there is no such library for Yocto (no impact on Edison). So 5.6.25 is the newest Percona server that you can install here.

The following simple (and rather useless) benchmark tests are performed on the Intel Edison:

Root@edison:/usr/local/mysql#cat/proc/cpuinfoprocessor:0vendor_id:genuineintelcpufamily:6model:74modelname: Genuineintel (R) Cpu4000@500mhz...mysql>selectbenchmark (10000000,encode (' Hello ', ' goodbye ')); +---------------- -------------------------------+| BENCHMARK (10000000,encode (' Hello ', ' goodbye ')) |+-----------------------------------------------+|0|+----------- ------------------------------------+1rowinset (18.77SEC) [/code]

Can MySQL bake bread for you?

The famous MySQL bug#2, submitted on September 12, 2002, and stated that "MySQL connector/j does not bake bread". Using the Intel Edison and Arduino compatible interface boards can now fix this bug: Now not only MySQL connector/j, the MySQL server itself can bake your bread! This can be done with a UDF, or by using the query Rewrite plugin in MySQL 5.7, so you can execute a MySQL query:

mysql>maketoast; [/code]

For practical implementations, you can either "hack" a toaster on hand to access the pins on the interface board, or use a compatible Arduino robotic Arm. All right, MySQL, bake me some bread!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.