使用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

你可能感兴趣的:(mysql,vim)