<p>I installed MySQL via <a href="http://en.wikipedia.org/wiki/MacPorts" rel="noreferrer">MacPorts</a>. What is the command I need to stop the server (I need to test how my application behave when MySQL is dead)?</p>

Apparently you want:
```
```
sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop
```
```
Have a further read in
Jeez People, Stop Fretting Over Installing RMagic
.