title: How to uninstall MySQL 5.6 when installed by brew on macOS?
body: <p>Installed MySQL by issuing the following commands:</p>
  
  <pre><code>$ brew install mysql56
  $ brew services start mysql@5.6
  </code></pre>
  
  <p>Now I can't access it:</p>
  
  <pre><code>$ mysql -uroot
  ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
  </code></pre>
  
  <p>Want to uninstall it and tried the following:</p>
  
  <pre><code>brew remove mysql
  brew cleanup
  
  sudo rm /usr/local/mysql
  sudo rm -rf /usr/local/var/mysql
  sudo rm -rf /usr/local/mysql*
  sudo rm ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
  sudo rm -rf /Library/StartupItems/MySQLCOM
  sudo rm -rf /Library/PreferencePanes/MySql*
  
  launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
  
  rm -rf ~/Library/PreferencePanes/My*    
  sudo rm -rf /Library/Receipts/mysql*
  sudo rm -rf /Library/Receipts/MySQL*
  sudo rm -rf /private/var/db/receipts/*mysql*
  
  (Restart computer)
  </code></pre>
  
  <p>Now work.</p>
  
  <p>When I install it again and run:</p>
  
  <pre><code>brew intall mysql56
  brew services start mysql@5.6
  </code></pre>
  
  <p>It shows:</p>
  
  <pre><code>Service `mysql@5.6` already started, use `brew services restart mysql@5.6` to restart.
  </code></pre>
  
  <p>But I can't find it in the process list.</p>