4/11/2010

I've recreated this page to support a more logical and portable installation of the latest MySQL GA source release in DamnSmallLinux and to package it as an extension.

  1. Executed with DSL-4.4.10 live CD loaded to the command prompt with the boot option command "dsl 2".   Because I'm running the live CD, there's no hard drive so if you intend to do the same, you will need about 650 MB Ram to build MySQL. You can also use a hard drive but that's outside the scope of this tutorial.
  2. Work out of the /opt directory so as to have space.
    1. cd /opt
  3. To compile MySQL you need to add some compiler tools to the system. You don't have to use wget, but I kept copies on my own local FTP server so that I could easily start over. Gcc1-with-libs.dsl and gnu-utils.dsl are both available in the MyDSL Browser. Mysql src came from www.mysql.org.
    1. wget ftp://[someserver]/mysql-5.1.45.tar.gz
    2. wget ftp://[someserver]/gcc1-with-libs.dsl
      1. http://distro.ibiblio.org/pub/linux/distributions/damnsmall/mydsl/system/gcc1-with-libs.dsl
      2. you can install from the command line with "mydsl-wget gcc1-with-libs.dsl system"
    3. wget ftp://[someserver]/gnu-utils.dsl
      1. http://distro.ibiblio.org/pub/linux/distributions/damnsmall/mydsl/system/gnu-utils.dsl
      2. you can install from the command line with "mydsl-wget gnu-utils.dsl system"
  4. Install the utilities (skip this if you used the browser)
    1. mydsl-load gcc1-with-libs.dsl
    2. mydsl-load gnu-utils.dsl
    3. tar xvzf mysql-5.0.67.tar.gz
  5. Clean up (for space)
    1. rm -f gcc1-with-libs.dsl
    2. rm -f gnu-utils.dsl
    3. rm -f mysql-5.0.67.tar.gz
  6. Compile mysql. "make -j4" and "sudo make install -j4" are for multiple processors. You may do better removing "-j4". Adjust your .configure options as you see fit.I'm putting everything into the /opt/mysql directory so this needs to be configured during the build.
    1. cd mysql-5.1.45
    2. ./configure --prefix=/opt/mysql --without-debug --without-man --without-docs --without-bench --without-innodb --without-ndb-test --without-ndb-debug --disable-dependency-tracking
    3. make -j4
    4. sudo make install -j4
  7. Clean up (for space)
    1. cd /opt
    2. rm -Rf mysql-5.1.45
  8. To make your DSL extension have an "out of the box" startup configuration, add this script to /opt/mysql as "dsl-setup.sh" or use the steps to get your database up and runnin
    1. sudo ln -s /opt/mysql/bin/* /opt/bin/
    2. #enable the man symlinks of you have man
    3. #sudo ln -s /opt/mysql/share/man/man1/* /usr/share/man/man1/
    4. #sudo ln -s /opt/mysql/share/man/man8/* /usr/share/man/man8/
    5. sudo adduser --system mysql
    6. sudo addgroup mysql
    7. sudo adduser mysql mysql
    8. sudo cp /opt/mysql/share/mysql/mysql.server /etc/init.d
    9. sudo cp /opt/mysql/share/mysql/my-small.cnf /etc/my.cnf
    10. sudo update-rc.d mysql.server defaults
    11. sudo mkdir /opt/mysql/var
    12. sudo /opt/bin/mysql_install_db
    13. sudo chgrp -R mysql /opt/mysql
    14. sudo chown -R mysql /opt/mysql
    15. sudo chmod -R u+wrx /opt/mysql
    16. sudo /etc/init.d/mysql.server start
  9. Make it executable
    1. chmod +x /opt/mysql/dsl-setup.sh
  10. Move to the FS root to package the extension.
    1. cd /
    2. tar -cvzf /ramdisk/mysql_5.1.45.dsl /opt/mysql
  11. To install this extension on another DSL box
    1. mydsl-load mysql_5.1.45.dsl
    2. sudo /opt/mysql/dsl-setup.sh

Want to do something dangerous to get root access to mysql from the network? From the mysql prompt:

mysql> GRANT ALL on *.* to 'root'@'%' identified by 'y0urPassw0rD';