Install MySQL in Leopard

    I believe that many have noticed that there is no dmg MySQL package for Leopard on the offsite MySQL. I did not take risks and “drive out” the tiger package, but simply assembled my database server directly from the source. This is done like this: You

    need to know / be able / have:
    • You know what a console is and how to use it (albeit at the teapot level - this will be enough)
    • You are familiar with the basics of * nix and have no problems with orgasm from a translucent console in MacOS X
    • You already have Xcode, if it is not, download and install Xcode 3.0 from offsite


    So, the thing, baby, yes!

    1. We need to add the following paths to our PATH (this is in .bash_profile)
      export PATH = "/ usr / local / bin: / usr / local / sbin: / usr / local / mysql / bin: $ PATH"
      

      Well, of course, upload this file
      . ~ / .bash_profile
      

    2. Making a new folder for sorts
      cd ~
      mkdir src
      cd src
      

    3. Download and unpack MySQL sorts
      curl -O http://mysql.he.net/Downloads/MySQL-5.0/mysql-5.0.45.tar.gz
      tar xzvf mysql-5.0.45.tar.gz
      cd mysql-5.0.45
      

    4. Launch the configurator
      CC = gcc CFLAGS = "- O3 -fno-omit-frame-pointer" CXX = gcc \
      CXXFLAGS = "- O3 -fno-omit-frame-pointer -felide-constructors \
      -fno-exceptions -fno-rtti "\
      ./configure --prefix = / usr / local / mysql \
      --with-extra-charsets = complex --enable-thread-safe-client \
      --enable-local-infile --enable-shared
      

    5. Compiling
      make
      sudo make install
      

    6. Well, initialize
      cd / usr / local / mysql
      sudo ./bin/mysql_install_db --user = mysql
      sudo chown -R mysql ./var
      


    That's all. The server is installed and ready to go. However, the haberman == is a lazy person, and therefore he de facto wants the server to start (and shut down) itself when the system boots. How to achieve this? Elementaryly, Watson, Mr. Jobs, and then prepared for the real Jedi special pills to enter the matrix. So:
    1. It is necessary to create the file com.mysql.mysqld.plist on the desktop and upload the following text into it:
      KeepaliveLabelcom.mysql.mysqldProgram/ usr / local / mysql / bin / mysqld_safeRunAtLoadUsernamemysqlWorking directory/ usr / local / mysql

    2. Next, this file must be marked in the right place.
      sudo mv ~ / Desktop / com.mysql.mysqld.plist / Library / LaunchDaemons
      sudo chown root /Library/LaunchDaemons/com.mysql.mysqld.plist
      

    3. Well, register in the system:
      sudo launchctl load -w /Library/LaunchDaemons/com.mysql.mysqld.plist
      

    4. Purely theoretically, everything is now in a bundle and the server is already running and is waiting for an honest developer to force it, you can check this with a simple command:
      mysql -uroot
      


    That, in fact, is all :)

    Also popular now: