Page Stats

Network Stats

 


Sponsor Links:



Mysql On Mips Based Raqs

This is a HOWTO for installing the MySQL database server on a Sun Cobalt MIPS-powered server appliance: Qube 2, RaQ 1, or RaQ 2 (it should also work on a Qube 2700 but I don't have one to verify).

DO NOT USE THIS PROCEDURE ON ANYTHING BUT A MIPS-BASED PRODUCT!!! (not for use on RaQ 3, RaQ 4, RaQ XTR, RaQ 550, or Qube 3) - see this page for procedures for those machines)

I designed this webpage so that you can just copy/paste each line/block of commands into your shell session and it will "just work" for you, thus avoiding typing. Text in red monospace is a literal Linux commandline, and should be typed or pasted exactly as written.

Some people have reported problems with steps of this procedure if too many lines are cut-and-pasted at once (some directories aren't generated properly, etc). To ensure proper operation, please do the commands one line at a time and wait for each command to complete before executing the next step.

INITIAL STEPS

Install all patches available from Sun

Visit SunSolve or My Page Here and download/install all available patches for your RaQ2. Install them in reverse order (from the bottom of the SunSolve page to the top) -- they are listed in reverse chronological order, and must be installed in sequence. Reboot the server if you had to install any patches, just to make sure everything is properly loaded, etc.

Create a "source" directory

NOTE: All remaining steps should be done as the 'root' user: Shell into the server as admin using telnet or SSH, then do:

su - root

The "-" is important, to ensure your environment variables (including search path) get set properly. Some commands will not work if you do not do this step correctly!

Then set up a "working" directory to upack and compile the source code in:

mkdir -p /home/src cd /home/src

Upgrade "broken" compiler and libraries

As the server exists in its default configuration, the compiler and some libraries are "broken" and will not permit you to compile working binaries. Download these files to the server:

wget http://cobalt.webtrafficstats.com/downloads/glibc-profile-2.0.7-29.4C2.mips.rpm
wget http://cobalt.webtrafficstats.com/downloads/glibc-debug-2.0.7-29.4C2.mips.rpm
wget http://cobalt.webtrafficstats.com/downloads/glibc-devel-2.0.7-29.4C2.mips.rpm
wget http://cobalt.webtrafficstats.com/downloads/glibc-2.0.7-29.4C2.mips.rpm

I have also mirrored these files on my own server, in case the "official" server goes away in the future.

glibc-profile-2.0.7-29.4C2.mips.rpm
glibc-debug-2.0.7-29.4C2.mips.rpm
glibc-devel-2.0.7-29.4C2.mips.rpm
glibc-2.0.7-29.4C2.mips.rpm

Then install them:

rpm -Uvh --force glibc*.rpm /sbin/ldconfig

Get these files as well:

wget http://cobalt.webtrafficstats.com/downloads/egcs-1.0.2-9.mipsel.rpm
wget http://cobalt.webtrafficstats.com/downloads/egcs-c++-1.0.2-9.mipsel.rpm
wget http://cobalt.webtrafficstats.com/downloads/egcs-g77-1.0.2-9.mipsel.rpm
wget http://cobalt.webtrafficstats.com/downloads/egcs-objc-1.0.2-9.mipsel.rpm
wget http://cobalt.webtrafficstats.com/downloads/libstdc++-2.8.0-9.mipsel.rpm
wget http://cobalt.webtrafficstats.com/downloads/libstdc++-devel-2.8.0-9.mipsel.rpm

I have also mirrored these on my own server (please try the "real" server first to save my bandwidth!):

egcs-1.0.2-9.mipsel.rpm
egcs-c++-1.0.2-9.mipsel.rpm
egcs-g77-1.0.2-9.mipsel.rpm
egcs-objc-1.0.2-9.mipsel.rpm
libstdc++-2.8.0-9.mipsel.rpm
libstdc++-devel-2.8.0-9.mipsel.rpm

and install them:

rpm -e --nodeps gcc-objc
rpm -e --nodeps gcc-c++
rpm -e --nodeps gcc
rpm -e --nodeps libg++-devel
rpm -Uvh egcs*.rpm
rpm -ivh libstdc++*.rpm

Get MySQL source code

Visit http://www.mysql.com/ and use an appropriate mirror to get the latest source code version (these directions assume v3.23.55). Source code tarballs are listed at the very bottom of the "http://www.internetdepot.org/cobalts" page...

Unpack code

cd /home/src tar zxvf mysql-3.23.55.tar.gz

This should leave you with the following directory structure:

/home/src/mysql-3.23.55

Build/Install MySQL

/usr/sbin/groupadd mysql
/usr/sbin/useradd -g mysql mysql
cd /home/src/mysql-3.23.55
./configure \
--with-low-memory \
--disable-assembler \
--disable-shared \
--with-mysqld-ldflags="-all-static" \
--with-client-ldflags="-all-static" \
--prefix=/home/mysql \
--localstatedir=/home/mysql/data \
--disable-maintainer-mode \
--with-mysqld-user=mysql \
--without-comment \
--without-debug \
--without-bench \
--without-test \
--without-raid


make
make install


Note: on my RaQ 2 with 32MB of RAM, configure takes about 5 minutes, and make takes about an hour to run... This is mentioned to give you some idea of how long to expect each step to take. You won't be able to do anything while either step is running...

./scripts/mysql_install_db

chown -R root:mysql /home/mysql

chown -R mysql:mysql /home/mysql/data

echo "/home/mysql/lib/mysql" >> /etc/ld.so.conf

ldconfig

Add startup command so MySQL starts automatically when server starts:

cp ./support-files/mysql.server /etc/rc.d/init.d

chmod +x /etc/rc.d/init.d/mysql.server

ln -s /etc/rc.d/init.d/mysql.server /etc/rc.d/rc3.d/S90mysql.server

Start MySQL and test it

/etc/rc.d/rc3.d/S90mysql.server start

cd /home/mysql/bin

./mysqladmin version

Set a new 'root' password

./mysqladmin -u root password new-password

Delete source

rm -rf /home/src/mysql*