Installing the APT extension

The ReadyNAS duo runs a Debian Sarge distribution. The apt-get commands are not available and we must install the APT addon:

  1. Download the APT extension. I've used the following link:

http://www.readynas.com/download/addons/4.00/APT_1.0.bin

  1. Go in the ReadyNAS FrontView with your browser and go to System -> Update -> Local Update
  2. Upload the APT binary file. The ReadyNAS verifies that content and if it is correct it displays a description of the addon.
  3. Acknowledge the installation of the addon

After installation, the ReadyNAS must be restarted. Shortly after, you will receive an email:

Subject: Addon Package Progress (nas-XX-XX-XX)
Successfully installed APT.

Debian Sarge Package update

It may be good to check the debian packages. Connect to the ReadyNAS using ssh and run the following commands:

apt-get update

Installation of Mysql server

The mysql-server-5.0 is supposed to be installed according to dpkg -i command. However, the files are not there and they have probably be removed. This is also the case for some utilities which are used by some installation scripts.

Preparation

The /usr/bin/chfn utility is missing and we need it for Mysql installation. We must re-install the passwd package. Download it and install it as follows;

# dpkg -i passwd_4.0.3-31sarge9_sparc.deb

The /usr/bin/logger is also missing. We must re-install the bsdutils_2.12p-4sarge2_sparc.deb package. Download it and install it as follows:

# dpkg -i bsdutils_2.12p-4sarge2_sparc.deb

Edit the /etc/mysql/my.cnf file and change the line:

user            = admin

into

user           = mysql

Additional packages

As reported by RoB (see comments), the following packages are also necessary for mysql-server:

# apt-get install libreadline5 libdbi-perl

Get Mysql packages

The mysql packages are part of backports.org (backport from Etch). You should download the following:

Mysql installation

Install the Mysql server debian packages:

# dpkg -i libmysqlclient15off_5.0.32-7etch5~bpo31+1_sparc.deb \
mysql-common_5.0.32-7etch5~bpo31+1_all.deb  \
mysql-server-5.0_5.0.32-7etch5~bpo31+1_sparc.deb \
mysql-client-5.0_5.0.32-7etch5~bpo31+1_sparc.deb \
mysql-client_5.0.32-7etch5~bpo31+1_all.deb
Installation Problem and Solution

If in the installation process you see a message '/etc/init.d/mysql' not found, force the extraction of mysql-server files without the execution of the installation script:

# dpkg --extract mysql-server-5.0_5.0.32-7etch5~bpo31+1_sparc.deb /

After that, redo the dpkg -i command.

If you see some errors in the logs:

[ERROR] /usr/sbin/mysqld: Can't find file: './mysql/host.frm' (errno: 13)

Fix ownership of some existing directories:

# chown mysql /var/lib/mysql
# chown mysql /var/lib/mysql/mysql

and restart mysql

Fix /etc/mysql/debian.cnf

After installation, the debian.cnf file used by mysqlcheck uses a user that does not exist. You can either create the debian-sys-maint user in mysql or change it to 'root' by editing the file /etc/mysql/debian.cnf and change user and password to use 'root'.

Fix startup scripts

Remove the following two startup scripts, they are not necessary for us:

  1. rm /etc/rc2.d/S18mysql-ndb
  2. rm /etc/rc2.d/S17mysql-ndb-mgm

Testing the database

Verify that the Mysql database is running:

nas-D2-24-F2:/var/log# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 6
Server version: 5.0.32-Debian_7etch5~bpo31+1 Debian etch distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql>