Mac : Installing Mysql on mac using brew

Look, if you just want to try out mysql only for learning then there is not need for local installation, you can try it out free at this site :

If you want to install Mysql on you mac machine then follow below steps :

  1. Install mysql with brew install mysql
  2. Start mysql with mysql.server start
  3. Connect mysql with mysql -uroot 
  4. Stop mysql with mysql.server stop


Note :

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

$ mysql -uroot

mysql.server stop

Once Mysql is installed you can check port number using below command



| Variable_name | Value |


| port          | 3306  |


1 row in set (0.00 sec)

Java : How to setup and run activeMQ for JMS on macos

Setup using command of home brew : 

➜ software brew install apache-activemq
==> Downloading
==> Best Mirror

curl: (28) Resolving timed out after 5539 milliseconds
Trying a mirror…
==> Downloading
######################################################################## 100.0%
🍺 /usr/local/Cellar/activemq/5.13.0: 559 files, 58.9M, built in 2 minutes 41 seconds


Go to default directory of active mq 

When you use brew the default installation directory on mac os is below
➜  software cd /usr/local/Cellar/activemq/

Starting the activemq service 

➜ bin git:(master) activemq start
INFO: Loading ‘/usr/local/Cellar/activemq/5.13.0/libexec//bin/env’
INFO: Using java ‘/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/bin/java’
INFO: Starting – inspect logfiles specified in and to get details
INFO: pidfile created : ‘/usr/local/Cellar/activemq/5.13.0/libexec//data/’ (pid ‘58039’)

Please verifiy the service is running using below command
➜  bin git:(master) ps -eaf | grep activemq

Testing the activemq service on bowser

Open below url and use id as “admin” and password as “admin” to login

Stopping the serving 

➜ bin git:(master) activemq stop
INFO: Loading ‘/usr/local/Cellar/activemq/5.13.0/libexec//bin/env’
INFO: Using java ‘/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/bin/java’
INFO: Waiting at least 30 seconds for regular process termination of pid ‘58039’ :
Java Runtime: Oracle Corporation 1.8.0_60 /Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/jre
Heap sizes: current=62976k free=61664k max=932352k
JVM args: -Xms64M -Xmx1G -Dactivemq.classpath=/usr/local/Cellar/activemq/5.13.0/libexec//conf:/usr/local/Cellar/activemq/5.13.0/libexec//../lib/ -Dactivemq.home=/usr/local/Cellar/activemq/5.13.0/libexec/ -Dactivemq.base=/usr/local/Cellar/activemq/5.13.0/libexec/ -Dactivemq.conf=/usr/local/Cellar/activemq/5.13.0/libexec//conf
Extensions classpath:
ACTIVEMQ_HOME: /usr/local/Cellar/activemq/5.13.0/libexec
ACTIVEMQ_BASE: /usr/local/Cellar/activemq/5.13.0/libexec
ACTIVEMQ_CONF: /usr/local/Cellar/activemq/5.13.0/libexec/conf
ACTIVEMQ_DATA: /usr/local/Cellar/activemq/5.13.0/libexec/data
Connecting to pid: 58039
INFO: Regular shutdown not successful, sending SIGKILL to process
INFO: sending SIGKILL to pid ‘58039’

Other tasks which can run as
$ activemq <taskname>

browse – Display selected messages in a specified destination.
bstat – Performs a predefined query that displays useful statistics regarding the specified broker
consumer – Receives messages from the broker
create – Creates a runnable broker instance in the specified path.
decrypt – Decrypts given text
dstat – Performs a predefined query that displays useful tabular statistics regarding the specified destination type
encrypt – Encrypts given text
export – Exports a stopped brokers data files to an archive file
list – Lists all available brokers in the specified JMX context
producer – Sends messages to the broker
purge – Delete selected destination’s messages that matches the message selector
query – Display selected broker component’s attributes and statistics.
start – Creates and starts a broker using a configuration file, or a broker URI.
stop – Stops a running broker specified by the broker name.

Mac : Stop and Start Cassandra DB on Mac OSX

For Mac use below commands to stop and start Cassandra :

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.cassandra.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.cassandra.plist

Once cassandra is running you can validate that by opening query prompt using


  aseem’s Mac ✗$ cqlsh                                                                

Connected to Test Cluster at

[cqlsh 5.0.1 | Cassandra 2.2.0 | CQL spec 3.3.0 | Native protocol v4]

Use HELP for help.


Mac : Installing Cassandra In Mac OS X ‘Mavericks’

First, you need Java 7 JDK, not to be confused with JRE. Cassandra won’t run without it. So run a java -version command before you proceed.

I used brew to install and maintain it for me 😉

brew install cassandra

After the  installation, run

brew info cassandra

This will print out the following instructions on the screen:

To reload cassandra after an upgrade:
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.cassandra.plist
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.cassandra.plist

There is probably a bug in the brew recipe for OS X Mavericks, as homebrew.mxcl.cassandra.plist was not copied to the target directory for me. It stayed in the brew install source directory, ~/usr/local/Cellar/cassandra/2.0.3, so I copied it over to ~/Library/LaunchAgents/ .

Now, take a look at homebrew.mxcl.cassandra.plist. The file reads:

<?xml version=”1.0″ encoding=”UTF-8″?>

<!DOCTYPE plist PUBLIC “-//Apple//DTD PLIST 1.0//EN” “”>

<plist version=”1.0″>

















As you can see, launchctl load ~/Library/LaunchAgents/homebrew.mxcl.cassandra.plist will start cassandra using the command /usr/local/opt/cassandra/bin/cassandra and it will keep it live, which means you can’t kill the process by pid.  it will just spring back to life again and again.  To stop cassandra, use the unload option.

Now, start Cassandra. But, you haven’t got a client to verify the server is working, have you?  CQL, the Cassandra Query Language client is not installed by Homebrew as part of the server install, unlike datastax distribution.

To install CQL with Homebrew,  do:

brew install python
pip install cql

now add the cqlsh script directory to your PATH.  I add mine to .bashrc:

export PATH=/usr/local/bin/:$PATH

Finally, run cqlsh

bash-3.2$ cqlsh

Connected to Test Cluster at localhost:9160.

[cqlsh 4.1.0 | Cassandra 2.0.3 | CQL spec 3.1.1 | Thrift protocol 19.38.0]

Use HELP for help.