RasPi Home Server - MySQL database server

Many applications require a database. Some may get around on simple files, but that typically falls over as soon as you need halfway decent performance, parallel access etc. MySQL originally was developed as a “proper” SQL database, but limiting itself to a subset of SQL, thereby being pretty quick and lightweight for those parts it actually could handle. Many web-based applications will work fine with MySQL. If your application needs more, a RasPi probably isn't the right platform for it anyway.

The installation is pretty straightforward:

aptitude install mysql-server mysql-client

During installation, you'll be asked for a root password for the mysql server.

Once the server is up and running, you may connect to it using the command line:

mysql -u root -p
(provide the password when asked)

You will end up on a mysql shell. Using help you can get help about the commands available here. A full manual is available with the reference manual.

When installing web-applications, chances are you'll need to create a database as well as mysql users with access to these databases. In the mysql shell, this may be done as such:

create database example;
grant all on example.* to 'user'@'localhost' identified by 'pass';
quit

You should now be able to connect to the example database:

mysql -u user -p example
(provide the password when asked)

Typically, web-applications will come with an installer where you can then provide the parameters/credentials you just configured.

One such web-application that may be of use (but should be well-protected) would be an administration interface for MySQL, such as phpMyAdmin. Installation thereof is left as an exercise for the reader.