Connect R to a MAMP MySQL Database


# NOTE: Edited since originally published due to a change in R...<br />require(RMySQL)<br />con &lt;- dbConnect(MySQL(), username="{USERNAME}", host="localhost", dbname="{DATABASE}", password="{PASSWORD}", unix.sock="/Applications/MAMP/tmp/mysql/mysql.sock")<br />res <- code="" con="" dat="" dbsendquery="" fetch="" from="" res=""><br /></->

Comments

4 responses to “Connect R to a MAMP MySQL Database”

  1. This has helped me greatly!! Thank you!

  2. Thanks! For some reason I had to swap "MySQL" for MySQL(). Probably due to some change since 2011

  3. Thanks for the comment and letting me know — I haven't tried it in some time!

  4. Yeah thanks for the help =) the same remark, it should be MySQL() instead of "MySQL"