リモートMySQLデータベース(AWS RDS)に接続するようにRMySQLをインストールして設定するにはどうすればよいですか?

nhuff717

私の問題に関連するシステム情報:

AWS RDS DB Instance
Instance Class - db.m1.small
Engine - MySQL 5.6.13

AWS EC2 Linux AMI
https://aws.amazon.com/amazon-linux-ami/2014.03-release-notes/

R version 3.0.2
i686-redhat-linux-gnu (32-bit)

Linux MySQL packages installed:
mysql.noarch            5.5-1.6.amzn1        @amzn-main   
mysql-server.noarch     5.5-1.6.amzn1        @amzn-main   
mysql55.i686            5.5.37-1.46.amzn1    @amzn-updates
mysql55-common.i686     5.5.37-1.46.amzn1    @amzn-updates
mysql55-libs.i686       5.5.37-1.46.amzn1    @amzn-updates
mysql55-server.i686     5.5.37-1.46.amzn1    @amzn-updates

前述のAWSLinuxAMIにRをインストールしました。MySQLを実行しているRDSインスタンスからRデータフレームにデータをプルしようとしています。

現在のところ、DBIパッケージをRにインストールしましたが、RMySQLのインストールが次のエラーで失敗します。

$> R CMD INSTALL RMySQL_0.9-3.tar.gz
* installing to library ‘/usr/lib/R/library’
* installing *source* package ‘RMySQL’ ...
** package ‘RMySQL’ successfully unpacked and MD5 sums checked
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... 
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking how to run the C preprocessor... gcc -E
checking for compress in -lz... yes
checking for getopt_long in -lc... yes
checking for mysql_init in -lmysqlclient... no
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking mysql.h usability... no
checking mysql.h presence... no
checking for mysql.h... no
checking for mysql_init in -lmysqlclient... no
checking for mysql_init in -lmysqlclient... no
checking for mysql_init in -lmysqlclient... no
checking for mysql_init in -lmysqlclient... no
checking for mysql_init in -lmysqlclient... no
checking for mysql_init in -lmysqlclient... no
checking for mysql_init in -lmysqlclient... no
checking /usr/local/include/mysql/mysql.h usability... no
checking /usr/local/include/mysql/mysql.h presence... no
checking for /usr/local/include/mysql/mysql.h... no
checking /usr/include/mysql/mysql.h usability... no
checking /usr/include/mysql/mysql.h presence... no
checking for /usr/include/mysql/mysql.h... no
checking /usr/local/mysql/include/mysql/mysql.h usability... no
checking /usr/local/mysql/include/mysql/mysql.h presence... no
checking for /usr/local/mysql/include/mysql/mysql.h... no
checking /opt/include/mysql/mysql.h usability... no
checking /opt/include/mysql/mysql.h presence... no
checking for /opt/include/mysql/mysql.h... no
checking /include/mysql/mysql.h usability... no
checking /include/mysql/mysql.h presence... no
checking for /include/mysql/mysql.h... no

Configuration error:
  could not find the MySQL installation include and/or library
  directories.  Manually specify the location of the MySQL
  libraries and the header files and re-run R CMD INSTALL.

INSTRUCTIONS:

1. Define and export the 2 shell variables PKG_CPPFLAGS and
   PKG_LIBS to include the directory for header files (*.h)
   and libraries, for example (using Bourne shell syntax):

      export PKG_CPPFLAGS="-I<MySQL-include-dir>"
      export PKG_LIBS="-L<MySQL-lib-dir> -lmysqlclient"

   Re-run the R INSTALL command:

      R CMD INSTALL RMySQL_<version>.tar.gz

2. Alternatively, you may pass the configure arguments
      --with-mysql-dir=<base-dir> (distribution directory)
   or
      --with-mysql-inc=<base-inc> (where MySQL header files reside)
      --with-mysql-lib=<base-lib> (where MySQL libraries reside)
   in the call to R INSTALL --configure-args='...' 

   R CMD INSTALL --configure-args='--with-mysql-dir=DIR' RMySQL_<version>.tar.gz

ERROR: configuration failed for package ‘RMySQL’
* removing ‘/usr/lib/R/library/RMySQL’

MySQLがインストールされている場所にインストールを指示する必要があることは明らかですが、適切なディレクトリの検索を開始する場所がわかりません。私は周りを見回すために次のことをしました:

$> find / -name mysql
/usr/share/mysql
/usr/lib/perl5/vendor_perl/auto/DBD/mysql
/usr/lib/perl5/vendor_perl/DBD/mysql
/usr/lib/mysql
/usr/bin/mysql
/var/lib/mysql
/var/lib/mysql/mysql

そのため、AWSLinuxインスタンスにはさまざまなMySQLディレクトリがあります。インストールパスでどちらを使用しますか?試行錯誤する必要がありますか?

私の他の質問は(RMySQLを正しくインストールすると仮定して)、RMySQLが機能するためには、MySQLサーバーがRもインストールされているのと同じ物理(仮想?)マシンで実行されている必要がありますか?

他の調査によると、MySQLデータベースへのRMySQL接続を機能させるにはSSHトンネルを作成する必要があります。これは本当ですか?私が間違っていなければ、AWSRDSはSSHトンネリングを許可していません。

他に何か提案はありますか?

Dirk Eddelbuettel

configure出力の最も重要な行を見逃しました:

checking for mysql.h... no

あなたは持っているランタイムパッケージ(複数可) MySQLのがインストールされています。ここで、開発パッケージが必要です。

Debian / Ubuntuの下で、これらのビルド依存を課します(そして私は最小バージョン要件を編集しました):

Build-Depends: debhelper, cdbs, r-base-dev, libmysqlclient-dev, r-cran-dbi

最初の2つはDebianパッケージ内部、3つ目はR、4つ目はMySQLであり、RH / FCが呼び出すものにマップする必要があり、最後の1つはDBI forRです。

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

TOP 一覧

  1. 1

    三項演算子良い練習の代わりとしてOptional.ofNullableを使用していますか?

  2. 2

    STSでループプロセス「クラスパス通知の送信」のループを停止する方法

  3. 3

    Spring Boot Filter is not getting invoked if remove @component in fitler class

  4. 4

    セレンのモデルダイアログからテキストを抽出するにはどうすればよいですか?

  5. 5

    tkinterウィンドウを閉じてもPythonプログラムが終了しない

  6. 6

    Ansibleで複数行のシェルスクリプトを実行する方法

  7. 7

    Python / SciPyのピーク検出アルゴリズム

  8. 8

    画像変更コードを実行してもボタンの画像が変更されない

  9. 9

    ビュー用にサイズ変更した後の画像の高さと幅を取得する方法

  10. 10

    VisualStudioコードの特異点/ドッカー画像でPythonインタープリターを使用するにはどうすればよいですか?

  11. 11

    Three.js indexed BufferGeometry vs. InstancedBufferGeometry

  12. 12

    __init__。pyファイルの整理中に循環インポートエラーが発生しました

  13. 13

    二次導関数を数値計算するときの大きな誤差

  14. 14

    値間の一致を見つける最も簡単な方法は何ですか

  15. 15

    androidsoongビルドシステムによるネイティブコードカバレッジ

  16. 16

    Reactでclsxを使用する方法

  17. 17

    How to access json value by key value in freemarker?

  18. 18

    エンティティIDを含む@RequestBody属性をSpringの対応するエンティティに変換します

  19. 19

    PyTesseractを使用した背景色のため、スクリーンショットからテキストを読み取ることができません

  20. 20

    Using Angular's UI-router, how can we make sure the new version of the html partial views are used, rather than the cached version?

  21. 21

    symfonyエラーサーバーが404NotFoundを返しました

ホットタグ

アーカイブ