Mac Ports无法安装mysql5


0

我试图通过Mac端口安装mysql,但没有运气:

/sites $ sudo port install mysql5
Password:
--->  Computing dependencies for mysql5
--->  Building mysql5
Error: org.macports.build for port mysql5 returned: command execution failed
Please see the log file for port mysql5 for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_distfiles.macports.org_ports_databases_mysql5/mysql5/main.log
To report a bug, follow the instructions in the guide:
    http://guide.macports.org/#project.tickets
Error: Processing of port mysql5 failed

以下是端口mysql / main.log的构建部分。运行make时好像失败了,但是我很难理解为什么。

:notice:build --->  Building mysql5
:debug:build Executing org.macports.build (mysql5)
:debug:build Environment:
CC_PRINT_OPTIONS='YES'
CC_PRINT_OPTIONS_FILE='/opt/local/var/macports/build/_opt_local_var_macports_sources_distfiles.macports.org_ports_databases_mysql5/mysql5/work/.CC_PRINT_OPTIONS'
CPATH='/opt/local/include'
LIBRARY_PATH='/opt/local/lib'
MACOSX_DEPLOYMENT_TARGET='10.9'
:debug:build Assembled command: 'cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_distfiles.macports.org_ports_databases_mysql5/mysql5/work/mysql-5.1.72" && /usr/bin/make -j8 -w all'
:debug:build Executing command line:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_distfiles.macports.org_ports_databases_mysql5/mysql5/work/mysql-5.1.72" && /usr/bin/make -j8 -w all
:info:build make: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_distfiles.macports.org_ports_databases_mysql5/mysql5/work/mysql-5.1.72'
:info:build Making all in .
:info:build make[1]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_distfiles.macports.org_ports_databases_mysql5/mysql5/work/mysql-5.1.72'
:info:build /Applications/Xcode.app/Contents/Developer/usr/bin/make abi_headers="include/mysql/plugin.h include/mysql.h" do_abi_check
:info:build make[2]: Entering directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_distfiles.macports.org_ports_databases_mysql5/mysql5/work/mysql-5.1.72'
:info:build set -ex; \
:info:build     for file in include/mysql/plugin.h include/mysql.h; do \
:info:build              /usr/bin/cc -E -nostdinc -dI -DMYSQL_ABI_CHECK \
:info:build                       -I./include \
:info:build                       -I./include/mysql \
:info:build                       -I./sql \
:info:build                       -I./include \
:info:build                       -I./include/mysql \
:info:build                       -I./sql \
:info:build                                      $file 2>/dev/null | \
:info:build                       /usr/bin/sed -e '/^# /d' \
:info:build                                 -e '/^[     ]*$/d' \
:info:build                                 -e '/^#pragma GCC set_debug_pwd/d' \
:info:build                                 -e '/^#ident/d' > \
:info:build                                            ./abi_check.out; \
:info:build                       /usr/bin/diff -w $file.pp ./abi_check.out; \
:info:build                       /bin/rm ./abi_check.out; \
:info:build     done
:info:build + for file in include/mysql/plugin.h include/mysql.h
:info:build + /usr/bin/cc -E -nostdinc -dI -DMYSQL_ABI_CHECK -I./include -I./include/mysql -I./sql -I./include -I./include/mysql -I./sql include/mysql/plugin.h
:info:build + /usr/bin/sed -e '/^# /d' -e '/^[  ]*$/d' -e '/^#pragma GCC set_debug_pwd/d' -e '/^#ident/d'
:info:build + /usr/bin/diff -w include/mysql/plugin.h.pp ./abi_check.out
:info:build + /bin/rm ./abi_check.out
:info:build + for file in include/mysql/plugin.h include/mysql.h
:info:build + /usr/bin/cc -E -nostdinc -dI -DMYSQL_ABI_CHECK -I./include -I./include/mysql -I./sql -I./include -I./include/mysql -I./sql include/mysql.h
:info:build + /usr/bin/sed -e '/^# /d' -e '/^[  ]*$/d' -e '/^#pragma GCC set_debug_pwd/d' -e '/^#ident/d'
:info:build + /usr/bin/diff -w include/mysql.h.pp ./abi_check.out
:info:build 3,4d2
:info:build < #include "mysql_version.h"
:info:build < #include "mysql_com.h"
:info:build 148d145
:info:build < #include "mysql_time.h"
:info:build 161d157
:info:build < #include "my_list.h"
:info:build 202,203d197
:info:build < #include "typelib.h"
:info:build < #include "my_alloc.h"
:info:build 241d234
:info:build < #include "my_alloc.h"
:info:build make[2]: *** [do_abi_check] Error 1
:info:build make[2]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_distfiles.macports.org_ports_databases_mysql5/mysql5/work/mysql-5.1.72'
:info:build make[1]: *** [abi_check] Error 2
:info:build make[1]: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_distfiles.macports.org_ports_databases_mysql5/mysql5/work/mysql-5.1.72'
:info:build make: *** [all-recursive] Error 1
:info:build make: Leaving directory `/opt/local/var/macports/build/_opt_local_var_macports_sources_distfiles.macports.org_ports_databases_mysql5/mysql5/work/mysql-5.1.72'
:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_distfiles.macports.org_ports_databases_mysql5/mysql5/work/mysql-5.1.72" && /usr/bin/make -j8 -w all
:info:build Exit code: 2
:error:build org.macports.build for port mysql5 returned: command execution failed
:debug:build Error code: CHILDSTATUS 84950 2
:debug:build Backtrace: command execution failed
    while executing
"system -nice 0 $fullcmdstring"
    ("eval" body line 1)
    invoked from within
"eval system $notty $nice \$fullcmdstring"
    invoked from within
"command_exec build"
    (procedure "portbuild::build_main" line 8)
    invoked from within
"portbuild::build_main org.macports.build"
    ("eval" body line 1)
    invoked from within
"eval $procedure $targetname"
:info:build Warning: targets not executed for mysql5: org.macports.activate org.macports.build org.macports.destroot org.macports.install
:notice:build Please see the log file for port mysql5 for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_distfiles.macports.org_ports_databases_mysql5/mysql5/main.log
(END)

Answers:


1

因此,事实证明,对于OS X 10.9,MySQL的端口当前失败。

我在这里找到了一个很好的选择:http : //www.macminivault.com/mysql-mavericks/。我使用他的建议安装了mysql:

bash <(curl -Ls http://git.io/eUx7rg)

一些提示:

  • 这为根用户分配了一个随机密码,该密码保存在桌面上的文本文件中
  • mysql安装在 usr/local/mysql
  • 用启动MySQL sudo /usr/local/mysql/support-files/mysql.server start
  • 用停止MySQL sudo mysqladmin shutdown

http://git.io/eUx7rg的内容

#!/bin/bash
#############################################
# AUTHOR: JONATHAN SCHWENN @JONSCHWENN      #
# MAC MINI VAULT - MAC MINI COLOCATION      #
# MACMINIVAULT.COM - @MACMINIVAULT          #
# VERSION 2.01 RELEASE DATE APR 09 2015     #
# DESC:  THIS SCRIPT INSTALLS MySQL on OSX  #
#############################################
#REQUIREMENTS:
#  OS X 10.7 or newer
#############################################
# CHECK FOR OS X 10.7+
if [[  $(sw_vers -productVersion | grep -E '10.[7-9]|1[0-0]')  ]]
then
# CHECK FOR EXISTING MySQL
if [[ -d /usr/local/mysql  ]]
then
echo "It looks like you already have MySQL installed..."
echo "This script will most likely fail unless MySQL is completley removed."
echo "If MySQL does install, your old version and databases will still be"
echo "under /usr/local/ and you will have to manually move databases to the"
echo "new install.  It's important to copy/move with permissions intact."
echo "..."
echo "..."
    while true; do
        read -p "DO YOU WANT TO CONTINUE? [y/N]" yn
        case $yn in
        [Yy]* ) break;;
        [Nn]* ) exit ;;
        * ) echo "Please answer yes or no.";;
        esac
    done
fi
# MYSQL INSTALLER WANTS A 'pidof' COMMAND SOMETIMES
# SO WE'LL GIVE IT A 'pidof' COMMAND
if [[ !  $(command -v pidof) ]]; then
if [ ! -d "$/usr/local/bin" ]; then
sudo mkdir -p /usr/local/bin
fi
# HARD TO CAT DIRECT TO BIN DIR, PUTTING IN DOCUMENTS THEN MOVING
sudo cat << 'EOF' > ~/Documents/pidof
#!/bin/sh
ps axc|awk "{if (\$5==\"$1\") print \$1}"
EOF
sudo mv ~/Documents/pidof /usr/local/bin/pidof
sudo chmod 755 /usr/local/bin/pidof
fi
# LOOKS GOOD, LETS GRAB MySQL AND GET STARTED ...
echo "Downloading MySQL Installers ... may take a few moments"
curl -# -Lo ~/Downloads/MySQL.dmg http://cdn.mysql.com/Downloads/MySQL-5.6/mysql-5.6.24-osx10.9-x86_64.dmg
hdiutil attach -quiet ~/Downloads/MySQL.dmg
# PLIST TO ALTER MySQL INSTALLER TO NOT ATTEMPT TO INSTALL STARTUP ITEMS
curl -s -o ~/Downloads/MySQL-install.plist https://raw.githubusercontent.com/MacMiniVault/Mac-Scripts/master/mmvMySQL/install.plist
# DEAR MySQL, WHY HAVE A SPECIFIC 10.9 DOWNLOAD IF IT JUST HAS THE 10.8 INSTALLER?
cd /Volumes/mysql-5.6.24-osx10.8-x86_64/
echo "..."
echo "..."
echo "Installing MySQL, administrator password required ..."
sudo installer -applyChoiceChangesXML ~/Downloads/MySQL-install.plist -pkg mysql-5.6.24-osx10.8-x86_64.pkg -target /
echo "..."
echo "..."
# AS OF RIGHT NOW MYSQL AUTOMATICALLY INSTALLS THE STARTUP ITEMS AND PREFPANE
# STARTUP ITEMS DO NOT WORK IN YOSEMITE - WE MADE A LAUNCHD START SETUP 
# TWO FILES ARE NEEDED
# A PLIST FOR LAUNCHD TO START ON BOOT
# AND A SCRIPT THAT THE PLIST LOADS, SCRIPT WAITS FOR NETWORKING TO INITIALIZE AND STARTS MySQL
curl -s -o ~/Downloads/mmv-start.sh https://raw.githubusercontent.com/MacMiniVault/Mac-Scripts/master/mmvMySQL/mmv-start.sh
sudo mv ~/Downloads/mmv-start.sh /usr/local/mysql/support-files/
sudo chown root:wheel /usr/local/mysql/support-files/mmv-start.sh
sudo chmod +x /usr/local/mysql/support-files/mmv-start.sh
curl -s -o ~/Downloads/com.mysql.server.plist https://raw.githubusercontent.com/MacMiniVault/Mac-Scripts/master/mmvMySQL/com.mysql.server.plist
sudo mv ~/Downloads/com.mysql.server.plist /Library/LaunchDaemons/
sudo chown root:wheel /Library/LaunchDaemons/com.mysql.server.plist
sudo chmod 644 /Library/LaunchDaemons/com.mysql.server.plist
        while true; do
                read -p "DO YOU WANT TO LOAD MySQL ON BOOT? [Y/n]" cnf
                case $cnf in
                [Yy]* ) sudo launchctl load -w /Library/LaunchDaemons/com.mysql.server.plist; break  ;;
                [Nn]* ) sudo launchctl load -w /Library/LaunchDaemons/com.mysql.server.plist; sudo launchctl unload -w /Library/LaunchDaemons/com.mysql.server.plist;  sudo /usr/local/mysql/support-files/mysql.server start; break;;
                * ) echo "Please answer yes or no.";;
                esac
        done
# ADDING MYSQL PATH TO BASH PROFILE, MAY CONFLICT WITH EXISTING PROFILES/.RC FILES
touch ~/.bash_profile >/dev/null 2>&1
echo -e "\nexport PATH=$PATH:/usr/local/mysql/bin" | sudo tee -a  ~/.bash_profile > /dev/null
sudo mkdir /var/mysql; sudo ln -s /tmp/mysql.sock /var/mysql/mysql.sock
sleep 10
# IF MySQL IS RUNNING, GENERATE, SET, AND DOCUMENT  ROOT PASSWORD
if [[  $(sudo /usr/local/mysql/support-files/mysql.server status | grep "SUCCESS") ]]
then
mypass="$(cat /dev/urandom | base64 | tr -dc A-Za-z0-9_ | head -c8)"
echo $mypass > ~/Desktop/MYSQL_PASSWORD
echo "Setting MySQL root Password to $mypass"
echo "Placing password on desktop..."
/usr/local/mysql/bin/mysql -uroot -e "GRANT ALL ON *.* TO 'root'@'localhost' IDENTIFIED BY '$mypass' WITH GRANT OPTION;"
echo "..."
echo "..."
# UNMOUNT AND DELELTE DOWNLOADED MySQL INSTALLER
cd ~/
hdiutil detach -quiet /Volumes/mysql-5.6.24-osx10.8-x86_64/
sleep 2
rm ~/Downloads/MySQL.dmg
rm ~/Downloads/MySQL-install.plist
# NEW MY.CNF PERFORMANCE OPTION START
echo "BASE PERFORMANCE MY.CNF IS JUST A GENERIC SUGGESTION FOR PERFORMANCE"
echo "YOUR RESULTS MAY VARY AND YOU MAY WANT TO FURTHER TUNE YOUR MY.CNF SETTINGS"
echo "BASE PERFORMANCE MY.CNF INCREASES BUFFERS/MEMORY USAGE"
echo "8GB+ RAM IS RECOMMENDED FOR BASE PERFORMANCE MY.CNF"
echo "..."
sudo cp /usr/local/mysql/my.cnf /usr/local/mysql/mmv.cnf
sudo tee -a /usr/local/mysql/mmv.cnf > /dev/null  << EOF

# CUSTOMIZED BY MMVMySQL SCRIPT - JUST GENERIC SETTINGS
# DO NOT TREAT AS GOSPEL

innodb_buffer_pool_size=2G
skip-name_resolve
max-connect-errors=100000
max-connections=500

EOF
        while true; do
                read -p "DO YOU WANT TO LOAD A BASE PERFORMANCE MY.CNF FILE? [y/N]" cnf
                case $cnf in
                [Yy]* ) sudo cp /usr/local/mysql/mmv.cnf /etc/my.cnf; sudo /usr/local/mysql/support-files/mysql.server restart; break  ;;
                [Nn]* ) break;;
                * ) echo "Please answer yes or no.";;
                esac
        done
# NEW MY.CNF PERFORMANCE OPTION END
# NEW SEQUEL PRO INSTALL OPTION START
while true; do
                read -p "DO YOU WANT TO AUTOMATICALLY INSTALL SEQUEL PRO? [Y/n]" sp
                case $sp in
                [Yy]* ) curl -# -o ~/Downloads/SequelPro.dmg https://sequel-pro.googlecode.com/files/sequel-pro-1.0.2.dmg; hdiutil attach -quiet ~/Downloads/SequelPro.dmg;cp -R /Volumes/Sequel\ Pro\ 1.0.2/Sequel\ Pro.app/ /Applications/Sequel\ Pro.app/; hdiutil detach -quiet /Volumes/Sequel\ Pro\ 1.0.2/;sleep 5; rm ~/Downloads/SequelPro.dmg; echo "Sequel Pro is now in your Applications folder!";  break  ;;
                [Nn]* ) break;;
                * ) echo "Please answer yes or no.";;
                esac
        done
# NEW SEQUEL PRO INSTALL OPTION END
echo " "
echo " "
echo "ALL DONE!  Install Sequel Pro or phpmyadmin to administer MySQL"
echo "Log off and log back in for 'mysql' to be recognized as a command in terminal"
else
"SORRY, MySQL IS NOT RUNNING ... THERE MUST BE A PROBLEM"
fi
else
echo "ERROR: YOU ARE NOT RUNNING OS X 10.7 OR NEWER"
exit 1
fi
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.