📜 ⬆️ ⬇️

Installing MySQL in Leopard

I believe that many have noticed that at the office of MySQL there is no dmg MySQL package for Leopard. I didn’t risk and run the tiger package, but just collected my database server directly from the sources. This is done like this:

It is necessary to know / be able / have:


So, in the matter, baby, yes!

  1. You 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 download this file.
     .  ~ / .bash_profile
    

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

  3. Swing and unpack the MySQL sors
     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. Run 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. Compile
     make
     sudo make install
    

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


Actually - that's all. The server is installed and ready to go. However, habrachelovek == a lazy person, but because he de facto wants the server to start (and shut down) itself when the system boots. How to achieve this? Elementary, Watson, Mr. Jobs and then prepared for these Jedi special pills to enter the matrix. So:
  1. You need to create a file on the desktop com.mysql.mysqld.plist and zafigachit the following text:
     <? xml version = "1.0" encoding = "UTF-8"?>
     <! DOCTYPE plist PUBLIC "- // Apple // DTD PLIST 1.0 // EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
     <plist version = "1.0">
     <dict>
         <key> KeepAlive </ key>
         <true />
         <key> Label </ key>
         <string> com.mysql.mysqld </ string>
         <key> Program </ key>
         <string> / usr / local / mysql / bin / mysqld_safe </ string>
         <key> RunAtLoad </ key>
         <true />
         <key> UserName </ key>
         <string> mysql </ string>
         <key> WorkingDirectory </ key>
         <string> / usr / local / mysql </ string>
     </ dict>
     </ plist>
    

  2. Further this file should 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. Theoretically, everything is now in a bundle and the server is already running and waiting for an honest developer to force it, you can check it with a simple command:
     mysql -uroot
    


That's all :)

')

Source: https://habr.com/ru/post/16129/


All Articles