Mysql4 version 4.1.22 - How to Download and Install on Mac OS X
Saturday the 7th of November, 2009

    version 4.1.22

      View the most recent changes for the mysql4 port at: mysql4.darwinports.com/diff
      Scroll down toward the bottom of the page to get installation instructions for mysql4.
      The raw portfile for mysql4 4.1.22 is located here:
      http://mysql4.darwinports.com/dports/databases/mysql4/Portfile
      Find related portfiles with the unique DarwinPorts.com search feature.
      Check for any related Fink projects here: pdb.finkproject.org/pdb/package.php/mysql4


      The mysql4 Portfile 57751 2009-09-16 05:04:20Z ryandesign macports.org $

      PortSystem 1.0

      Name: mysql4
      conflicts mysql5 mysql5-devel
      Version: 4.1.22
      Homepage: http://www.mysql.com/
      Category: databases
      Platform: darwin
      Maintainers: ryandesign openmaintainer
      license GPLv2
      distname mysql-${version}
      use_parallel_build yes

      Description: Multithreaded SQL database server

      Long Description: MySQL is an open-source, multi-threaded SQL database with a command syntax very similar to mSQL.

      set sitedir Downloads/MySQL-4.1/
      Master Sites: http://www.mirrorservice.org/sites/ftp.mysql.com/${sitedir} http://www.softagency.co.jp/MySQL/${sitedir} http://mirrors.tilian.co.uk/mysql.com/${sitedir} ftp://planetmirror.com/pub/mysql/${sitedir} ftp://sunsite.dk/mirrors/mysql/${sitedir} http://mysql.mediatraffic.fi/${sitedir} ftp://filepile.tiscali.de/mirror/mysql/${sitedir} ftp://ftp.rtfm.no/pub/mysql/${sitedir} http://www.mysql.cz/${sitedir} ftp://ftp.u-paris10.fr/mysql.com/${sitedir} http://mysql.oms-net.nl/${sitedir} ftp://ftp.free.fr/pub/MySQL\${sitedir}

      Checksums: md5 37b4479951fa0cf052269d27c41ca200

      depends_lib port:openssl

      set dbdir ${prefix}/var/db/mysql

      post-patch {
      reinplace "s%/etc/my.cnf%${prefix}/etc/${name}/my.cnf%g" ${worksrcpath}/scripts/mysqlaccess.sh ${worksrcpath}/scripts/mysqld_multi.sh ${worksrcpath}/scripts/mysqldumpslow.sh ${worksrcpath}/scripts/mysqlhotcopy.sh ${worksrcpath}/sql-bench/bench-init.pl.sh ${worksrcpath}/support-files/my-huge.cnf.sh ${worksrcpath}/support-files/my-innodb-heavy-4G.cnf.sh ${worksrcpath}/support-files/my-large.cnf.sh ${worksrcpath}/support-files/my-medium.cnf.sh ${worksrcpath}/support-files/my-small.cnf.sh ${worksrcpath}/support-files/mysql.server.sh
      reinplace "s%/etc/%${prefix}/etc/${name}/%g" ${worksrcpath}/mysys/default.c
      }

      configure.args --mandir=${prefix}/share/man --infodir=${prefix}/share/info --localstatedir=${dbdir} --sysconfdir=${prefix}/etc/${name} --with-openssl=${prefix} --with-extra-charsets=complex --with-innodb --with-unix-socket-path=${prefix}/var/run/mysqld/mysqld.sock --with-mysqld-user=mysql --without-debug --without-bench --enable-thread-safe-client

      Variant: server {
      # Create a startupitem to start/stop the server
      startupitem.create yes
      startupitem.start "${prefix}/share/mysql/mysql.server start"
      startupitem.stop "${prefix}/share/mysql/mysql.server stop"
      }

      pre-destroot {
      xinstall -m 755 -d ${destroot}${prefix}/var/log/mysql
      destroot.keepdirs ${destroot}${prefix}/var/log/mysql

      if { [variant_isset server] } {
      addgroup mysql
      set gid [existsgroup mysql]
      adduser mysql gid=${gid} realname=MySQL\ Server

      system "chown mysql:mysql ${destroot}${prefix}/var/log/mysql"
      }
      }

      post-destroot {
      system "rm -rf ${destroot}${prefix}/mysql-test"

      xinstall -m 775 -d ${destroot}${dbdir}
      xinstall -m 755 -d ${destroot}${prefix}/var/run/mysqld
      destroot.keepdirs-append ${destroot}${dbdir}
      destroot.keepdirs-append ${destroot}${prefix}/var/run/mysqld
      if { [variant_isset server] } {
      xinstall -o root -m 755 -d ${destroot}${prefix}/etc/${name}
      xinstall -o root -m 644 -c ${filespath}/my.cnf ${destroot}${prefix}/etc/${name}/my.cnf.sample
      reinplace "s|__PREFIX|${prefix}|g" ${destroot}${prefix}/etc/${name}/my.cnf.sample
      xinstall -o mysql -g mysql -m 775 -d ${destroot}${dbdir}
      destroot.keepdirs-append ${destroot}${dbdir}
      system "chown -R mysql:mysql ${destroot}${dbdir}"

      xinstall -o mysql -g mysql -m 755 -d ${destroot}${prefix}/var/run/mysqld
      destroot.keepdirs-append ${destroot}${prefix}/var/run/mysqld
      system "chown -R mysql:mysql ${destroot}${prefix}/var/run/mysqld"
      }
      }

      post-install {
      ui_msg "******************************************************"
      ui_msg "* You might want to run *"
      ui_msg "* sudo -u mysql mysql_install_db *"
      ui_msg "* if this is a new install *"
      ui_msg "* *"
      ui_msg "* If you did not choose the server variant you may *"
      ui_msg "* add a mysql user and you will need to change the *"
      ui_msg "* ownership to that user for the following: *"
      ui_msg "* ${dbdir} *"
      ui_msg "* ${prefix}/var/run/mysqld *"
      ui_msg "* ${prefix}/var/log/mysql *"
      ui_msg "******************************************************"
      }

      livecheck.type none

    If you haven't already installed Darwin Ports, you can find easy instructions for doing so at the main Darwin Ports page.

    Once Darwin Ports has been installed, in a terminal window and while online, type the following and hit return:


      %  cd /opt/local/bin/portslocation/dports/mysql4
      % sudo port install mysql4
      Password:
    You will then be prompted for your root password, which you should enter. You may have to wait for a few minutes while the software is retrieved from the network and installed for you. Y ou should see something that looks similar to:

      ---> Fetching mysql4
      ---> Verifying checksum for mysql4
      ---> Extracting mysql4
      ---> Configuring mysql4
      ---> Building mysql4 with target all
      ---> Staging mysql4 into destroot
      ---> Installing mysql4
    - Make sure that you do not close the terminal window while Darwin Ports is working. Once the software has been installed, you can find further information about using mysql4 with these commands:
      %  man mysql4
      % apropos mysql4
      % which mysql4
      % locate mysql4

     Where to find more information:

    Darwin Ports



    Lightbox this page.