perl mysql module installed fail on Windows - mysql

I'm trying to install mysql using:
cpanm DBD::mysql
I got output error like this: Set up gcc environment - 3.4.5 (mingw-vista special r3)
--> Working on DBD::mysql
Fetching http: //www.cpan.org/authors/id/C/CA/CAPTTOFU/DBD-mysql-4.025.tar.gz ... OK
Configuring DBD-mysql-4.025 ... OK
Building and testing DBD-mysql-4.025 ... FAIL
! Installing DBD::mysql failed. See C:\Users\myuser\cpanm\work\1384776992.9536\build.log for details. Retry with --force to force install it
When I opened the log file to check the detail, it's as bellows. Is there anyone help me out:
cpanm (App::cpanminus) 1.7001 on perl 5.012004 built for MSWin32-x86-multi-thread
Work directory is C:\Users\myuser/.cpanm/work/1384776992.9536
You have make C:\Perl\site\bin\dmake.exe
You have LWP 6.02
Falling back to Archive::Tar 1.76
Searching DBD::mysql on cpanmetadb ...
--> Working on DBD::mysql
Fetching http://www.cpan.org/authors/id/C/CA/CAPTTOFU/DBD-mysql-4.025.tar.gz
-> OK
Unpacking DBD-mysql-4.025.tar.gz
Entering DBD-mysql-4.025
Checking configure dependencies from META.yml
Checking if you have DBI 1.08 ... Yes (1.616)
Configuring DBD-mysql-4.025
Running Makefile.PL
Set up gcc environment - 3.4.5 (mingw-vista special r3)
mysql_config.pl, and an associated bat file, has been
successfully created under
C:\PROGRA~1\MySQL\MYSQLS~1.1\bin
Unknown option: testdb
Unknown option: testhost
Unknown option: testuser
PLEASE NOTE:
For 'make test' to run properly, you must ensure that the
database user '' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.
mysql> grant all privileges on test.* to ''#'localhost' identified by 's3kr1t';
You can also optionally set the user to run 'make test' with:
perl Makefile.PL --testuser=username
Unknown option: testpassword
Unknown option: testsocket
Unknown option: testport
Unknown option: nocatchstderr
Unknown option: ssl
Unknown option: nofoundrows
Unknown option: force-embedded
I will use the following settings for compiling and testing:
cflags (mysql_config) = -I"C:\PROGRA~1\MySQL\MYSQLS~1.1\include"
embedded (mysql_config) =
ldflags (mysql_config) =
libs (mysql_config) = -LC:\PROGRA~1\MySQL\MYSQLS~1.1\lib\opt -lmysqlclient -lzlib
mysql_config (guessed ) = mysql_config
nocatchstderr (default ) = 0
nofoundrows (default ) = 0
ssl (guessed ) = 0
testdb (default ) = test
testhost (default ) =
testpassword (default ) =
testport (default ) =
testsocket (default ) =
testuser (guessed ) =
To change these settings, see 'perl Makefile.PL --help' and
'perldoc DBD::mysql::INSTALL'.
Checking if your kit is complete...
Warning: the following files are missing in your kit:
META.json
t/mem_leak.pl
Please inform the author.
Note (probably harmless): No library found for -lmysqlclient
Note (probably harmless): No library found for -lzlib
Using DBI 1.616 (for perl 5.012004 on MSWin32-x86-multi-thread) installed in C:/Perl/lib/auto/DBI/
Writing Makefile for DBD::mysql
-> OK
Finding PREREQ from Makefile ...
Checking if you have Test::More 0 ... Yes (0.98)
Checking if you have Data::Dumper 0 ... Yes (2.128)
Checking if you have Test::Deep 0 ... Yes (0.110)
Checking if you have DBI 1.08 ... Yes (1.616)
Building and testing DBD-mysql-4.025
cp lib/DBD/mysql.pm blib\lib\DBD\mysql.pm
cp lib/DBD/mysql/GetInfo.pm blib\lib\DBD\mysql\GetInfo.pm
cp README.pod blib\lib\DBD\README.pod
cp lib/DBD/mysql/INSTALL.pod blib\lib\DBD\mysql\INSTALL.pod
cp lib/Bundle/DBD/mysql.pm blib\lib\Bundle\DBD\mysql.pm
C:/Perl/site/bin/gcc.exe -c -IC:\Perl\lib\auto\DBI -I"C:\PROGRA~1\MySQL\MYSQLS~1.1\include" - DDBD_MYSQL_INSERT_ID_IS_GOOD -g -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -D_USE_32BIT_TIME_T -DPERL_MSVCRT_READFIX -DHASATTRIBUTE -fno-strict-aliasing -mms-bitfields -O2 -DVERSION=\"4.025\" -DXS_VERSION=\"4.025\" "-IC:\Perl\lib\CORE" dbdimp.c
In file included from dbdimp.c:18:
dbdimp.h:21:49: mysql.h: No such file or directory
dbdimp.h:22:45: mysqld_error.h: No such file or directory
dbdimp.h:24:49: errmsg.h: No such file or directory
In file included from dbdimp.c:18:
dbdimp.h:157: error: syntax error before "MYSQL"
dbdimp.h:157: warning: no semicolon at end of struct or union
dbdimp.h:180: error: syntax error before '}' token
dbdimp.h:255: error: syntax error before "MYSQL_RES"
dbdimp.h:255: warning: no semicolon at end of struct or union
dbdimp.h:258: error: syntax error before "row_num"
dbdimp.h:258: warning: data definition has no type or storage class
dbdimp.h:263: error: syntax error before "insertid"
dbdimp.h:263: warning: data definition has no type or storage class
dbdimp.h:267: error: conflicting types for 'use_mysql_use_result'
dbdimp.h:165: error: previous declaration of 'use_mysql_use_result' was here
dbdimp.h:274: error: syntax error before '}' token
...............................................
-> FAIL Installing DBD::mysql failed. See C:\Users\wangw35\.cpanm\work\1384776992.9536\build.log for details. Retry with --force to force install it.

These are the two important lines.
Note (probably harmless): No library found for -lmysqlclient
Note (probably harmless): No library found for -lzlib
You need to install the mysqlclient (and also zlib) on your system.

Related

Fail in installing DBD::mysql in Mac using cpanm

I am constantly failing in installing DBD::mysql.
The command I used was:
brew install mysql
cpanm DBD::mysql
The error I got was:
--> Working on DBD::mysql
Fetching http://www.cpan.org/authors/id/D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz ... OK
Configuring DBD-mysql-4.050 ... N/A
! Configure failed for DBD-mysql-4.050. See /Users/jeji/.cpanm/work/1642350924.83890/build.log for details.
Therefore, I checked by log file. My log file read:
cpanm (App::cpanminus) 1.9018 on perl 5.030003 built for darwin-thread-multi-2level
Work directory is /Users/jeji/.cpanm/work/1642350924.83890
You have make /usr/bin/make
You have LWP: 6.44
You have LWP::Protocol::https: 6.07
You have /usr/bin/tar: bsdtar 3.5.1 - libarchive 3.5.1 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.8
You have /usr/bin/unzip
Searching DBD::mysql () on cpanmetadb ...
--> Working on DBD::mysql
Fetching http://www.cpan.org/authors/id/D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz
-> OK
Unpacking DBD-mysql-4.050.tar.gz
Entering DBD-mysql-4.050
Checking configure dependencies from META.json
Checking if you have DBI 1.609 ... Yes (1.643)
Checking if you have Data::Dumper 0 ... Yes (2.174)
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.34)
Checking if you have Devel::CheckLib 1.09 ... Yes (1.14)
Configuring DBD-mysql-4.050
Running Makefile.PL
PLEASE NOTE:
For 'make test' to run properly, you must ensure that the
database user 'jeji' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.
mysql> grant all privileges on test.* to 'jeji'#'localhost' identified by 's3kr1t';
You can also optionally set the user to run 'make test' with:
perl Makefile.PL --testuser=username
I will use the following settings for compiling and testing:
cflags (mysql_config) = -I/usr/local/Cellar/mysql/8.0.27_1/include/mysql
embedded (guessed ) =
ldflags (guessed ) =
libs (mysql_config) = -L/usr/local/Cellar/mysql/8.0.27_1/lib -lmysqlclient -lz -lzstd -lssl -lcrypto -lresolv
mysql_config (guessed ) = mysql_config
nocatchstderr (default ) = 0
nofoundrows (default ) = 0
nossl (default ) = 0
testdb (default ) = test
testhost (default ) =
testpassword (default ) =
testport (default ) =
testsocket (default ) =
testuser (guessed ) = jeji
To change these settings, see 'perl Makefile.PL --help' and
'perldoc DBD::mysql::INSTALL'.
Checking if libs are available for compiling...
Can't link/include C library 'ssl', 'crypto', aborting.
-> N/A
Checking dependencies from META.json ...
Checking if you have Time::HiRes 0 ... Yes (1.9760)
Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.34)
Checking if you have Test::Deep 0 ... Yes (1.130)
Checking if you have Test::Simple 0.90 ... Yes (1.302162)
Checking if you have bigint 0 ... Yes (0.51)
Checking if you have DBI 1.609 ... Yes (1.643)
-> FAIL Configure failed for DBD-mysql-4.050. See /Users/jeji/.cpanm/work/1642350924.83890/build.log for details.
I do think that 'Can't link/include C library 'ssl', 'crypto', aborting.
-> N/A' is the part that is causing the issue, but I have no clue in how to approach the problem.
Any solutions would be great!
Thanks in advance :)
Here's how I got DBD::mysql installed on macOS:
cpan -T DBI
sudo cpanm DBD::mysql -n \
--configure-args="--libs='-L/usr/local/opt/openssl/lib -lssl -lcrypto -lperconaserverclient'"
I was installing Percona Server instead of MySQL so you might not need the last option.
Update: In more recent releases of MacOS, I can't get this to work. I tried for a few days to resolve the compile errors, but then I gave up. I'll use Python now. The era of Perl is over, which makes me sad because I've enjoyed using Perl since around 1996.

Can't install "DBD-mysql" on Mac

When running this command: perl -MCPAN -e 'install DBD::mysql' I get a really long output of different errors:
Reading '/Users/philipjoss/.cpan/Metadata'
Database was generated on Tue, 07 Sep 2021 21:29:03 GMT
Running install for module 'DBD::mysql'
Checksum for /Users/philipjoss/.cpan/sources/authors/id/D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz ok
Configuring D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz with Makefile.PL
Can't exec "mysql_config": No such file or directory at Makefile.PL line 89.
Cannot find the file 'mysql_config'! Your execution PATH doesn't seem
not contain the path to mysql_config. Resorting to guessed values!
PLEASE NOTE:
For 'make test' to run properly, you must ensure that the
database user 'philipjoss' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.
mysql> grant all privileges on test.* to 'philipjoss'#'localhost' identified by 's3kr1t';
You can also optionally set the user to run 'make test' with:
perl Makefile.PL --testuser=username
Can't exec "mysql_config": No such file or directory at Makefile.PL line 603.
Can't find mysql_config. Use --mysql_config option to specify where mysql_config is located
Can't exec "mysql_config": No such file or directory at Makefile.PL line 603.
Can't find mysql_config. Use --mysql_config option to specify where mysql_config is located
Can't exec "mysql_config": No such file or directory at Makefile.PL line 603.
Can't find mysql_config. Use --mysql_config option to specify where mysql_config is located
I will use the following settings for compiling and testing:
cflags (guessed) = -I/usr/local/mysql/include
embedded (guessed) =
libs (guessed) = -L/usr/local/mysql/lib -lmysqlclient -lz -lm -lcrypt -lnsl
mysql_config (guessed) = mysql_config
nocatchstderr (default) = 0
nofoundrows (default) = 0
nossl (default) = 0
testdb (default) = test
testhost (default) =
testpassword (default) =
testport (default) =
testsocket (default) =
testuser (guessed) = philipjoss
To change these settings, see 'perl Makefile.PL --help' and
'perldoc DBD::mysql::INSTALL'.
Checking if libs are available for compiling...
dyld: Library not loaded: #rpath/libmysqlclient.21.dylib
Referenced from: /Users/philipjoss/.cpan/build/DBD-mysql-4.050-5/assertlib3PEYQc80
Reason: image not found
Can't link/include C library 'crypt', 'nsl', aborting.
Warning: No success on command[/usr/bin/perl Makefile.PL]
DVEEDEN/DBD-mysql-4.050.tar.gz
/usr/bin/perl Makefile.PL -- NOT OK
There seems to be quite a few posts and articles on this kind of error but the solutions all seem to be Linux focussed. I think the key part of this is that I need a mysql_config file but I have no idea where to start on this!
MacOS is 11.5.2. Perl is 5.30.2. MySQL is 8.0.26.
Thanks in advance!
Update:
Adding the specific mysql directory to my path as suggested in the comments below has got me a little further along but I'm getting a whole different set of errors now:
Reading '/Users/philipjoss/.cpan/Metadata'
Database was generated on Tue, 07 Sep 2021 21:29:03 GMT
Running install for module 'DBD::mysql'
Checksum for /Users/philipjoss/.cpan/sources/authors/id/D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz ok
Configuring D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz with Makefile.PL
PLEASE NOTE:
For 'make test' to run properly, you must ensure that the
database user 'philipjoss' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.
mysql> grant all privileges on test.* to 'philipjoss'#'localhost' identified by 's3kr1t';
You can also optionally set the user to run 'make test' with:
perl Makefile.PL --testuser=username
I will use the following settings for compiling and testing:
cflags (mysql_config) = -I/usr/local/mysql-8.0.26-macos11-x86_64/include
embedded (guessed ) =
ldflags (guessed ) =
libs (mysql_config) = -L/usr/local/mysql-8.0.26-macos11-x86_64/lib -lmysqlclient -lssl -lcrypto -lresolv
mysql_config (guessed ) = mysql_config
nocatchstderr (default ) = 0
nofoundrows (default ) = 0
nossl (default ) = 0
testdb (default ) = test
testhost (default ) =
testpassword (default ) =
testport (default ) =
testsocket (default ) =
testuser (guessed ) = philipjoss
To change these settings, see 'perl Makefile.PL --help' and
'perldoc DBD::mysql::INSTALL'.
Checking if libs are available for compiling...
dyld: Library not loaded: #rpath/libmysqlclient.21.dylib
Referenced from: /Users/philipjoss/.cpan/build/DBD-mysql-4.050-6/assertlib3PoRLEqr
Reason: image not found
dyld: Library not loaded: libssl.1.1.dylib
Referenced from: /Users/philipjoss/.cpan/build/DBD-mysql-4.050-6/assertlib_CG2WA4d
Reason: image not found
dyld: Library not loaded: libcrypto.1.1.dylib
Referenced from: /Users/philipjoss/.cpan/build/DBD-mysql-4.050-6/assertlib0lH0wftp
Reason: image not found
wrong result: 'mysqlclient', 'ssl', 'crypto'
Warning: No success on command[/usr/bin/perl Makefile.PL]
DVEEDEN/DBD-mysql-4.050.tar.gz
/usr/bin/perl Makefile.PL -- NOT OK
Update 2:
Following advice from the comments below I've switched to perlbrew and after one failure I've now finally got it installed (it took about 45 mins each time). Running my script now using perlbrew exec perl oncourt_update.pl now returns the original error: install_driver(mysql) failed: Can't locate DBD/mysql.pm in #INC. I've tried an installation using perlbrew use perl-5.34.0; cpan DBD::mysql however I get the following output:
Loading internal logger. Log::Log4perl recommended for better logging
Reading '/Users/philipjoss/.cpan/Metadata'
Database was generated on Tue, 07 Sep 2021 21:29:03 GMT
Running install for module 'DBD::mysql'
Checksum for /Users/philipjoss/.cpan/sources/authors/id/D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz ok
'YAML' not installed, will not store persistent state
Configuring D/DV/DVEEDEN/DBD-mysql-4.050.tar.gz with Makefile.PL
PLEASE NOTE:
For 'make test' to run properly, you must ensure that the
database user 'philipjoss' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.
mysql> grant all privileges on test.* to 'philipjoss'#'localhost' identified by 's3kr1t';
You can also optionally set the user to run 'make test' with:
perl Makefile.PL --testuser=username
I will use the following settings for compiling and testing:
cflags (mysql_config) = -I/usr/local/Cellar/mysql/8.0.26/include/mysql
embedded (guessed ) =
ldflags (guessed ) =
libs (mysql_config) = -L/usr/local/Cellar/mysql/8.0.26/lib -lmysqlclient -lz -lzstd -lssl -lcrypto -lresolv
mysql_config (guessed ) = mysql_config
nocatchstderr (default ) = 0
nofoundrows (default ) = 0
nossl (default ) = 0
testdb (default ) = test
testhost (default ) =
testpassword (default ) =
testport (default ) =
testsocket (default ) =
testuser (guessed ) = philipjoss
To change these settings, see 'perl Makefile.PL --help' and
'perldoc DBD::mysql::INSTALL'.
Checking if libs are available for compiling...
Can't link/include C library 'ssl', 'crypto', aborting.
Warning: No success on command[/Users/philipjoss/perl5/perlbrew/perls/perl-5.34.0/bin/perl Makefile.PL]
DVEEDEN/DBD-mysql-4.050.tar.gz
/Users/philipjoss/perl5/perlbrew/perls/perl-5.34.0/bin/perl Makefile.PL -- NOT OK
Looking at the output the line mysql> grant all privileges on test.* to 'philipjoss'#'localhost' looks strange as philipjoss isn't the username for localhost. Could this be something to do with the error? I note that the output states:
database user 'philipjoss' can connect to your MySQL server
and has the proper privileges that these tests require such
as 'drop table', 'create table', 'drop procedure', 'create procedure'
as well as others.```

Compiling MariaDB Connector v1.0.5 and/or Mysql Connection v 5.3.4

I am trying to compile MariaDB Connector v1.0.5 and/or Mysql Connection v 5.3.4.
I have MariaDB Server v.10.0.21 installed on a Slackware server. I just need to get a MYSQL connector working, doesn't matter which one.
Also applied the patch mentioned in Is there compatible ODBC driver with Mariadb 10 on Linux?
When I compile the MariaDB Connector I get an error saying "MariaDB not found".
When I compile the Mysql Connector I get the following error:
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
MYSQL_LIB
linked by target "myodbc5a" in directory /downloads/mysql-connector-odbc-5.3.4-src/driver
linked by target "myodbc5w" in directory /downloads/mysql-connector-odbc-5.3.4-src/driver
linked by target "myodbc5S" in directory /downloads/mysql-connector-odbc-5.3.4-src/setupgui
linked by target "myodbc-installer" in directory /downloads/mysql-connector-odbc-5.3.4-src/installer
OUTOUT from Error File
Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp
Run Build Command:/usr/bin/gmake "cmTryCompileExec3523358880/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec3523358880.dir/build.make CMakeFiles/cmTryCompileExec3523358880.dir/build
gmake1: Entering directory /downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec3523358880.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTryCompileExec3523358880.dir/CheckFunctionExists.c.o -c /usr/share/cmake-2.8/Modules/CheckFunct
ionExists.c
Linking C executable cmTryCompileExec3523358880
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec3523358880.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTryCompileExec3523358880.dir/CheckFunctionExists.c.o -o cmTryCompileExec3523358880 -rdynamic -lpth
reads
/usr/lib64/gcc/x86_64-slackware-linux/4.8.2/../../../../x86_64-slackware-linux/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
gmake[1]: *** [cmTryCompileExec3523358880] Error 1
gmake[1]: Leaving directory/downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec3523358880/fast] Error 2
Determining if the function dlopen exists failed with the following output:
Change Dir: /downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp
Run Build Command:/usr/bin/gmake "cmTryCompileExec1888052970/fast"
/usr/bin/gmake -f CMakeFiles/cmTryCompileExec1888052970.dir/build.make CMakeFiles/cmTryCompileExec1888052970.dir/build
gmake1: Entering directory /downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp'
/usr/bin/cmake -E cmake_progress_report /downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp/CMakeFiles 1
Building C object CMakeFiles/cmTryCompileExec1888052970.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=dlopen -o CMakeFiles/cmTryCompileExec1888052970.dir/CheckFunctionExists.c.o -c /usr/share/cmake-2.8/Modules/CheckFunctionExist
s.c
Linking C executable cmTryCompileExec1888052970
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec1888052970.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=dlopen CMakeFiles/cmTryCompileExec1888052970.dir/CheckFunctionExists.c.o -o cmTryCompileExec1888052970 -rdynamic
CMakeFiles/cmTryCompileExec1888052970.dir/CheckFunctionExists.c.o: In functionmain':
CheckFunctionExists.c:(.text+0x15): undefined reference to dlopen'
collect2: error: ld returned 1 exit status
gmake[1]: *** [cmTryCompileExec1888052970] Error 1
gmake[1]: Leaving directory/downloads/mysql-connector-odbc-5.3.4-src/CMakeFiles/CMakeTmp'
gmake: *** [cmTryCompileExec1888052970/fast] Error 2
Blockquote
Just use the precompiled versions. Copy the libraries to the lib and include directories.

R library RMySQL doesn't start

I have installed R3.0.1. Rtools is also installed. MySQL version 5.7 is installed. I want to connect R to MySQL, and I am trying to do that through RMySQL package in R.
While the installation of RMySQL is finally done after looking at various SO questions, the library command gives error. Please see below complete R logs. Please help.
> install.packages("RMySQL",type="source")
trying URL 'http://cran.rstudio.com/src/contrib/RMySQL_0.9-3.tar.gz'
Content type 'application/x-gzip' length 165363 bytes (161 Kb)
opened URL
downloaded 161 Kb
* installing *source* package 'RMySQL' ...
** package 'RMySQL' successfully unpacked and MD5 sums checked
checking for $MYSQL_HOME... C:/Program Files/MySQL/MySQL Server 5.7
cygwin warning:
MS-DOS style path detected: C:/Program
Preferred POSIX equivalent is: /cygdrive/c/Program
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
test: Files/MySQL/MySQL: unknown operand
** libs
Warning: this package has a non-empty 'configure.win' file,
so building only the main architecture
cygwin warning:
MS-DOS style path detected: D:/SOFTWA~1/R-30~1.3/etc/x64/Makeconf
Preferred POSIX equivalent is: /cygdrive/d/SOFTWA~1/R-30~1.3/etc/x64/Makeconf
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
gcc -m64 -I"D:/SOFTWA~1/R-30~1.3/include" -DNDEBUG -I"C:/Program Files/MySQL/MySQL Server 5.7"/include -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall - std=gnu99 -mtune=core2 -c RS-DBI.c -o RS-DBI.o
RS-DBI.c: In function 'RS_na_set':
RS-DBI.c:1219:11: warning: variable 'c' set but not used [-Wunused-but-set-variable]
gcc -m64 -I"D:/SOFTWA~1/R-30~1.3/include" -DNDEBUG -I"C:/Program Files/MySQL/MySQL Server 5.7"/include -I"d:/RCompile/CRANpkg/extralibs64/local/include" -O2 -Wall - std=gnu99 -mtune=core2 -c RS-MySQL.c -o RS-MySQL.o
RS-MySQL.c: In function 'RS_MySQL_fetch':
RS-MySQL.c:657:13: warning: variable 'fld_nullOk' set but not used [-Wunused-but-set- variable]
RS-MySQL.c: In function 'RS_DBI_invokeBeginGroup':
RS-MySQL.c:1137:30: warning: variable 'val' set but not used [-Wunused-but-set-variable]
RS-MySQL.c: In function 'RS_DBI_invokeNewRecord':
RS-MySQL.c:1158:20: warning: variable 'val' set but not used [-Wunused-but-set-variable]
RS-MySQL.c: In function 'RS_MySQL_dbApply':
RS-MySQL.c:1219:38: warning: variable 'fld_nullOk' set but not used [-Wunused-but-set-variable]
gcc -m64 -shared -s -static-libgcc -o RMySQL.dll tmp.def RS-DBI.o RS-MySQL.o C:/Program Files/MySQL/MySQL Server 5.7/bin/libmySQL.dll - Ld:/RCompile/CRANpkg/extralibs64/local/lib/x64 -Ld:/RCompile/CRANpkg/extralibs64/local/lib -LD:/SOFTWA~1/R-30~1.3/bin/x64 -lR
installing to D:/Softwares/R-3.0.3/library/RMySQL/libs/x64
** R
** inst
** preparing package for lazy loading
Creating a generic function for 'format' from package 'base' in package 'RMySQL'
Creating a generic function for 'print' from package 'base' in package 'RMySQL'
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
MYSQL_HOME defined as C:/Program Files/MySQL/MySQL Server 5.7
* DONE (RMySQL)
The downloaded source packages are in
‘C:\Users\mitrabhanu.panda\AppData\Local\Temp\RtmpgZHT8R\downloaded_packages’
> library(RMySQL)
Looking in C:\Program Files/MySQL, C:/MySQL, D:/MySQL, E:/MySQL, F:/MySQL, G:/MySQL, C:/xampp/MySQL, D:/xampp/MySQL, E:/xampp/MySQL, F:/xampp/MySQL, G:/xampp/MySQL, C:/Apps/MySQL, D:/Apps/MySQL, E:/Apps/MySQL, F:/Apps/MySQL, G:/Apps/MySQL
Found C:\Program Files/MySQL
Error : .onLoad failed in loadNamespace() for 'RMySQL', details:
call: setwd(bin)
error: character argument expected
Error: package or namespace load failed for ‘RMySQL’
Please let me know what I have done wrong.
As written in my comment, here is the sample code for reading a table from mysql:
require(RJDBC)
j <- JDBC(classPath='/path/to/mysql/jdbc/jar', driverClass='com.mysql.jdbc.Driver')
connection <- dbConnect(j, 'jdbc:mysql://localhost/databasename', 'myusername','mypassword')
on.exit(dbDisconnect(connection))
data.frame.from.sql <- dbReadTable(connection, 'tablename')
This will read the table named tablename from databasename into data.frame.from.sql as an R data frame that you can manipulate as you see fit. I hope this helps.

Trying to install DBD::mysql using macports mysql and perl fails make test [Snow Leopard]

I have recently installed mysql5 and perl5 through macports in order to try and subvert an earlier issue of running perl script architecture discrepancies (introduced as of OSX10.6).
Downloaded the DBD::mysql package and seek to manually install it.
perl Makefile works well, as does make.
make test, however, yields the following:
PERL_DL_NONLAZY=1 /opt/local/bin/perl5 "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00base....................ok 1/6
# Failed test 'use DBD::mysql;'
# at t/00base.t line 21.
# Tried to use 'DBD::mysql'.
# Error: Can't load '/Users/ianseyer/Downloads/DBD-mysql- 4.011/blib/arch/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Users/ianseyer/Downloads/DBD-mysql-4.011/blib/arch/auto/DBD/mysql/mysql.bundle, 2): Symbol not found: _is_prefix
# Referenced from: /Users/ianseyer/Downloads/DBD-mysql- 4.011/blib/arch/auto/DBD/mysql/mysql.bundle
# Expected in: dynamic lookup
# at (eval 7) line 2
# Compilation failed in require at (eval 7) line 2.
# BEGIN failed--compilation aborted at (eval 7) line 2.
t/00base....................NOK 2/6FAILED--Further testing stopped: Unable to load DBD::mysql
make: *** [test_dynamic] Error 255
Any ideas? Thanks.
I would start by trying to install the macports version of DBD::mysql:
sudo port install p5-dbd-mysql
If that doesn't work, try cpanm:
cpanm -S DBD::Mysql
Only use manual installation as a last resort.