无法在OSX Sierra上安装RMySQL

时间:2017-01-30 23:24:48

标签: r rmysql

我正在尝试在运行OSX Sierra ver 10.12.2的Mac上安装RMySQL

我已经回顾了为OSX Mavericks提供的自制MySQL安装的评论和建议。我已经使用MySQL / Oracle安装程序安装了MySQL,因此我尝试使用R-Studio中的以下命令(R版本3.3.1“头发中的错误”)将我的安装的特定路径替换为自制路径:< / p>

Sys.setenv(PKG_CPPFLAGS = "-I//usr/local/mysql-5.7.17-macos10.12-x86_64/include/")
Sys.setenv(PKG_LIBS="-L/usr/local/mysql-5.7.17-macos10.12-x86_64/lib/ -lmysqlclient")

然后我尝试按如下方式安装/构建RMySQL包

install.packages("RMySQL", type="source")

我收到以下错误消息

trying URL 'https://cran.rstudio.com/src/contrib/RMySQL_0.10.9.tar.gz'
Content type 'application/x-gzip' length 54012 bytes (52 KB)
==================================================
downloaded 52 KB

* installing *source* package ‘RMySQL’ ...
** package ‘RMySQL’ successfully unpacked and MD5 sums checked
Using PKG_CFLAGS=-I/usr/local/opt/mariadb-connector-c/include/mariadb
Using PKG_LIBS=-L/usr/local/opt/{openssl/lib,mariadb-connector-   c/lib/mariadb} -lmysqlclient -lssl -lcrypto -lz
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libmysqlclient was not found. Try installing:
* deb: libmariadb-client-lgpl-dev (Debian, Ubuntu 16.04)
    libmariadbclient-dev (Ubuntu 14.04)
* rpm: mariadb-devel | mysql-devel (Fedora, CentOS, RHEL)
* csw: mysql56_dev (Solaris)
* brew: mariadb-connector-c (OSX)
If libmysqlclient is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libmysqlclient.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘RMySQL’
* removing    ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/RMySQL’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/RMySQL’
Warning in install.packages :
installation of package ‘RMySQL’ had non-zero exit status

The downloaded source packages are in
‘/private/var/folders/6h/29_3qxmn0sd0n7zh7qr65txm0000gp/T/RtmpjmKIr5/downloaded_packages’

我认为安装会覆盖我设置的环境变量,但我不确定。

我对使用HomeBrew并不熟悉,因为我使用标准安装包在Mac上安装了所有软件。如果可能的话,我宁愿不卸载MySQL并通过HomeBrew重新安装,因为我已经有几个正在使用的数据库。我使用Linux的经验有限,但还不足以理解用于构建RMySQL的底层构建过程和环境变量,因此我不知道如何修改我找到的安装RMySQL的其他任何示例在网站上。

0 个答案:

没有答案