purpen 发表于 2013-1-15 02:02:41

Mac OS X安装MySQL步骤

# create the directory where you will keep your MySQL binary distributionmkdir ~/srccd ~/src # download mysql binary distribution from http://dev.mysql.com/downloads/mysql/# then move the distribution into your src directorymv /path/to/mysql/download.tar.gz ~/src# make sure you are in ~/src (use pwd if unsure) then untargunzip < /path/to/mysql-VERSION-OS.tar.gz | tar xvf - # create the MySQL groupdscl . create /Groups/mysql# give it some group iddscl . create /Groups/mysql gid 296# create a MySQL userdscl . -create /Users/mysql# make the MySQL user a member of the MySQL groupdscl . append /Groups/mysql GroupMembership mysql# change ownership to mysqlchown -R mysql .chgrp -R mysql . # install mysqlscripts/mysql_install_db --user=mysql# make a symlink in the /usr/local directory or you can customize the location in support-files/mysql.server if you prefermkdir /usr/localcd /usr/local/ln -s /full/path/to/your/mysql/install/directory mysql # you should now be able to start the serversupport-files/mysql.server start # add mysql to your PATH# in ~/.bash_profileexport PATH=/usr/local/mysql/bin:$PATHsource ~/.bash_profile# should bring up the mysql CLImysql# exit mysql> exit # set mysql server to auto start upon bootmkdir /Library/StartupItems/MySQLCOMcd /Library/StartupItems/MySQLCOM/ln -s /usr/local/mysql/support-files/mysql.server MySQLCOM # test for success/Library/StartupItems/MySQLCOM/MySQLCOM stop/Library/StartupItems/MySQLCOM/MySQLCOM start # create a root passwordmysqladmin -u root password your_root_password 
每次重装系统后都要重新编译mysql,但是,都会出现一些小问题,导致这些问题的直接原因都是用户权限的设置。在此总结完整的安装步骤,供查阅。
页: [1]
查看完整版本: Mac OS X安装MySQL步骤