#Dev Environment (Mac)
How to Check the Version of a Script/Tool
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
Once you’ve installed Homebrew, insert the Homebrew directory at the top of your PATH environment variable. You can do this by adding the following line at the bottom of your ~/.bashrc file
upgrade specific package:
brew upgrade package
brew update && brew install mongodb --with-openssl
Create the data directory
mkdir -p /data/db
-p is for creating intermediate directories as required.
#####Set permissions for the data directory. Before running mongod for the first time, ensure that the user account running mongod has read and write permissions for the directory.
… To have launchd start mongodb at login:
ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents
Then to load mongodb now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
Or, if you don’t want/need launchctl, you can just run:
mongod --config /usr/local/etc/mongod.conf
wget https://bootstrap.pypa.io/get-pip.py && python get-pip.py
sudo pip install -U pip
If setuptools (or distribute) is not already installed, get-pip.py will install setuptools for you.
Pip is worth using over easy_install for its uninstall capabilities alone, but I should mention that pip is actively maintained while setuptools is mostly dead.
curl https://bootstrap.pypa.io/ez_setup.py -o - | python
pip install -U setuptools
sudo pip install virtualenv
brew doctorand fix any errors
brew updateupdate packages
- (optional) run upgarde
brew upgradeafterwards. upgrade might take some time
brew install mysqlinstall mysql
mysql_install_db --verbose --user=whoami
--basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
- run the commands Brew suggests, add MySQL to
launchctlso it automatically launches at startup
mysql should now work and be running all the time as expected
To have launchd start mysql at login:
ln -sfv /usr/local/opt/mysql/*.plist ~/Library/LaunchAgents Then to load mysql now: launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist Or, if you don't want/need launchctl, you can just run: mysql.server start
To start mysqld at boot time you have to copy
support-files/mysql.server to the right place for your system
/usr/local/opt/mysql/bin/mysqladmin -u root password 'new-password' /usr/local/opt/mysql/bin/mysqladmin -u root -h Serenity.local password 'new-password'
Alternatively you can run:
which will also give you the option of removing the test databases and anonymous user created by default. This is strongly recommended for production servers.
mysql.server stop and
brew info mysql
echo 'source "`brew --prefix grc`/etc/grc.bashrc"' >> ~/.bash_profile so new shell sessions start using GRC.
install all tools in one go with the following command:
brew doctor && brew update && brew upgrade && brew install wget && brew install nano && brew install tree && brew install grc && echo 'source "`brew --prefix grc`/etc/grc.bashrc"' >> ~/.bash_profile
why you should be using pip and virtualenv MySQL install: Uninstall all those broken versions of MySQL and re-install it with Brew on Mac Mavericks Installing multiple brew packages in one go: Is it safe to run multiple brew install commands at the same time?
LAMP on Mac
Installing Apache, PHP, and MySQL on Mac OS X Native LAMP stack How to install Apache and PHP on a Mac with OSX 10.8 Install MySQL on Mac OSX using Homebrew Reset MySQL root password on Mac OS How to Change the MySQL root Password in Linux or OSX via Command Line