User Tools

Site Tools


hannibal:mysqlserver

Several application that form part of the Hannibal systemstack rely on a MySQL-database for data storage. You could of course install a RDBMS per server or per virtual server, however we prefer to install a centralized storage backend that is available via TCP/IP. This documentation describes how to install a MySQL-server on Debian Etch.

Documentation on howto make the MySQL-database available in an environment that depends on the Apache webserver and PHP is available at the Hannibal webserver section.

Installation

Debian Etch contains a package for MySQL-server version 5 (at the moment 5.0.32).

apt-get install mysql-server-5.0

Configuration

As the package does not set credentials for the MySQL root-account we'll do that right now:

mysqladmin -u root -p password your_root_passwd

By default MySQL only listens on localhost. You have to make it available for the outside yourself. Edit /etc/mysql/my.cnf:

...
bind-address            = your_ip_address
...

Restart the database server:

/etc/init.d/mysql restart

Usermanagement

We usually create a separate account per database administrator. This allows for securing the MySQL-root account credentials (only use them in case of an emergency). Let's create a new database administrator 'handb'. In our example this user is allowed to connect to the MySQL-server from all hosts.

 mysql -u root -p -e "grant all on *.* to handb@'%' identified by 'your_password' with grant option"
 mysql -u root -p -e "flush privileges"

Please don't ever use your database administrator accounts for individual applications. Just create a database-account per application and/or per application role. This strategy allows for only granting just enough permissions…

hannibal/mysqlserver.txt · Last modified: 2008/06/25 11:42 by Olivier Brugman