使用MacPorts安装MySQL5, 比较喜欢MacPorts的管理方式

开始我用AppZapper删除了dmg版本,以为都删掉了,捣腾了好久,几次不成功,是因为dmg版本的干扰,装好后启动了原来dmg版本,有点囧。哎

安装方法:

ericdemacbook:~ Eric$ sudo port install mysql5-server
---> Fetching mysql5
---> Verifying checksum(s) for mysql5
---> Extracting mysql5
---> Applying patches to mysql5
---> Configuring mysql5
---> Building mysql5
---> Staging mysql5 into destroot
---> Installing mysql5 @5.0.84_0
---> Activating mysql5 @5.0.84_0
---> Cleaning mysql5
---> Fetching mysql5-server
---> Verifying checksum(s) for mysql5-server
---> Extracting mysql5-server
---> Configuring mysql5-server
---> Building mysql5-server
---> Staging mysql5-server into destroot
---> Creating launchd control script
###########################################################
# A startup item has been generated that will aid in
# starting mysql5-server with launchd. It is disabled
# by default. Execute the following command to start it,
# and to cause it to launch at startup:
#
# sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
###########################################################
---> Installing mysql5-server @5.0.84_0
******************************************************
* In order to setup the database, you might want to run
* sudo -u mysql mysql_install_db5
* if this is a new install
******************************************************
---> Activating mysql5-server @5.0.84_0
---> Cleaning mysql5-server
ericdemacbook:~ Eric$ sudo -u mysql mysql_install_db5
...
ericdemacbook:~ Eric$ sudo /opt/local/bin/mysqld_safe5 &
[1] 53056
ericdemacbook:~ Eric$ Starting mysqld daemon with databases from /opt/local/var/db/mysql5

为了不方便使用,把下面aliases内容添加到 .profile,
ericdemacbook:~ Eric$ vim .profile
alias mysqlstart='sudo /opt/local/bin/mysqld_safe5 &'
alias mysqlstop='/opt/local/bin/mysqladmin5 -u root -p shutdown'
因为不喜欢每次开机都自动运行, 需要用的时候才打开,(PS:
sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值