1. Download MySQL Windows version *without installer*
  2. Unzip this file somewhere, and then put everything in C:/Program Files/MySQL/mysqlsources/.
  3. Right click My Computer, then Advanced/Environment Variables. Add a User variable MYSQL_HOME with value C:\Program Files\MySQL\mysqlsources.
  4. You should have everything installed to make packages on Windows.
  5. In addition to the above, you need MinGW-utils. Simply download the tarball and then do tar xvfz mingw-utils-<version>.tar.gz in C:/MinGW.
  6. Follow the instructions in README.windows:
  7. cd into C:/Program Files/MySQL/mysqlsources/lib/opt
  8. Create LIBMYSQL.def by typing reimp --only-def libmySQL.lib
  9. Create libmySQL.a by typing dlltool --dllname libmySQL.dll --def LIBMYSQL.def --output-lib libmySQL.a -k
  10. Now biocLite("RMySQL", type = "source") should install no problem.