RPi MySQL
Contents
Installing MySQL on Raspberry Pi
This is a guide to install MySQL Community Edition (aka "MySQL") on the Raspberry Pi computer running Debian "squeeze".
MySQL is comprised of two distinct components:
- MySQL Server
- The program that actually stores and processes the data.
There is generally no way to interact with the data stored in the database server without using an external client or library.
- The program that actually stores and processes the data.
- MySQL Client
- A program or library that connects to an existing MySQL database server.
This is considered a "front end" to the database - a way for the user to send and retrieve data from the database server.
- A program or library that connects to an existing MySQL database server.
The guide has been developed/tested using debian6-19-04-2012. Depending on how you choose to install Ruby, there may not be enough room on a standard 2Gb image. This is especially true if you've already installed anything else. Learn how to expand your image here or here.
Installing MySQL Server From The Debian Repository
Commands
# Install MySQL Server from the Debian repository sudo apt-get install mysql-server
The package manager may suggest a slew of dependencies for MySQL Server. Press "Y" then "enter" (or just "enter") to continue installation. The MySQL installation process will prompt for a password for the MySQL root user account. You can enter a password, or press "enter" to skip the password step - it is your choice. It is poor security to have a blank password if you will be running the MySQL Server on a shared network, but shouldn't matter if you are only using the system for development. The installation process will prompt you two additional times for a MySQL root password. Continue entering the same password (or skipping it) as you did at the first prompt. The MySQL Client is installed as part of the standard MySQL Server package from the Debian repository. You do not need to install additional software to start using MySQL.
Testing Your Installation
# Verify the MySQL Client was installed mysql --version
# Connect to the MySQL Server on localhost mysql --user=root --password=password
Installing MySQL Client From The Debian Repository
The MySQL Client is a "front end" to an existing database; it does not install the MySQL Server. The MySQL Client can be used to connect to MySQL Server databases across a network. It provides a text-based interface to a MySQL Server, and requires a basic understanding of standard SQL commands. (ie SELECT, UPDATE, INSERT, and DELETE).
Commands
# Install MySQL Client from the Debian repository sudo apt-get install mysql-client
The package manager may suggest a slew of dependencies for MySQL Client. Press "Y" then "enter" (or just "enter") to continue installation.