I was trying to build my app on linux using mysql c api, and got this error at link stage, it's working fine on windows. Please help, thanks!
error message:
/bin/ld: myapp.so : version node not found for symbol mysql_select_db#libmysqlclient_16
/bin/ld: failed to set dynamic section sizes: Bad value
OS: CentOS 7, 64-bit, (VM on virtual box)
Mysql: 5.6.24 (community edition, installed via yum)
.bashrc file
export LIBMYSQL_INCLUDE_DIR=/usr/include/mysql
export LIBMYSQL_LIBRARY=/usr/lib64/mysql
export LD_LIBRARY_PATH=/usr/lib64/mysql:$LD_LIBRARY_PATH
cmake file: (variables are set according to environment variables)
FILE(GLOB SRC_MYAPP myapp/*.c myapp/*.h)
INCLUDE_DIRECTORIES(${LIBMYSQL_INCLUDE_DIR})
ADD_LIBRARY(myapp ${SRC_MYAPP})
IF (MSVC_IDE)
TARGET_LINK_LIBRARIES(myapp ${LIBMYSQL_LIBRARY}/libmysql)
ELSE ()
TARGET_LINK_LIBRARIES(myapp ${LIBMYSQL_LIBRARY}/libmysqlclient_r.a)
ENDIF ()
Put #hank 's comment as answer
I suppose you should add link_directories(/usr/lib64/mysql) before add_library and then target_link_libraries(myapp mysqlclient_r) – hank May 12 at 12:50
Related
I have a project with a connection that was working properly on the same device. I suddenly got the error below. And I could connect from the same device through MySQL workbench.
What could be the reason?
library(RMySQL)
con <- dbConnect(RMySQL::MySQL(),
host = "xxx",
dbname="yyy",
user = "zzz",
password = "############")
Error in .local(drv, ...) :
Failed to connect to database: Error: Lost connection to MySQL server at 'reading authorization packet', system error: 10060
And here's the session info
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RMySQL_0.10.10 DBI_0.4-1
loaded via a namespace (and not attached):
[1] tools_3.3.1
My code started having this exact problem after doing a system wide package update on 3/29/2017 for the first time since 2/1/2017.
Looking at the versioning for RMySQL,
RMySQL_0.10.9.tar.gz published 2016-05-08 15:39
RMySQL_0.10.10.tar.gz published 2017-03-21 07:50
I reverted my version to 0.10.9 and the problem went away:
require(devtools)
install_version("RMySQL", version = "0.10.9", repos = "http://cran.us.r-project.org")
I posted your issue to the RMySQL bug page, so we'll see if they address it
I checked another latest version of RMySQL package recently, RMySQL_0.10.11.zip
The problem exists in that too.
Apologies, cant comment as not allowed currently, hence wanted to update about the version where the problem is still being seen.
Additional Info
Connection to MySQL on my system is working from
1) Cmdline
2) MySQL Workbench
3) Tableau
4) Excel
It is just not working on R.
I checked following
link1
link2
link3
SHOW GLOBAL STATUS like 'Aborted%clients%';
And every time connection is dropped from R, the value of above variable goes +1.
Even doing
SET GLOBAL connect_timeout = 10;
has not helped.
UPDATE
Is there a dependency/requirement for PERL to be installed for usage of RMySQL?
As of now, my system does not have PERL. if this requirement is indeed true, then that might be 1 of the reason and may be the latest version has the problem fixed. Please let me know about the PERL dependency?
I was able to fix this issue on my PC using R 3.4 by following #Page's advice to look into the package versioning. However, not only did I need to install an earlier version of RMySQL (reverting from 0.10.11 to 0.10.9), I also needed to change versions on its dependancy package DBI (reverting from 0.6-1 to 0.5), using the following command:
require(devtools)
install_version("DBI", version = "0.5", repos = "http://cran.us.r-project.org")
install_version("RMySQL", version = "0.10.9", repos = "http://cran.us.r-project.org")
I want to build libmysql.dll, so I got source code mysql-connector-c-6.1.6-src.zip from http://dev.mysql.com/downloads/connector/c/.
Then cmake-gui.exe to configure and generate vc 2008 sln, leave all settings default.
Then got errors and warnings when building, like this:
mysql-connector-c-6.1.6-src\include\thr_cond.h(109) : error C2065: “ETIMEDOUT”: 未声明的标识符(an unspecified identifier)
mysql-connector-c-6.1.6-src\include\thr_rwlock.h(80) : warning C4013: “TryAcquireSRWLockShared” 未定义(not defined)
mysql-connector-c-6.1.6-src\include\thr_rwlock.h(102) : warning C4013: “TryAcquireSRWLockExclusive” 未定义(not defined)
I searched the source, and find ETIMEDOUT is defined in my_pthread.h, so I include this header in thr_cond.h, but still error.
And TryAcquireSRWLockShared and TryAcquireSRWLockExclusive seem only supported on Win7 and later !
Do I have done something wrong?
How can I build libmysql?
Any help will be appreciated.
Download the previous version (6.0.2), it doesn's use the TryAcquireSRWLockShared() API function.
With a few minor tweeks, it compiles clean with MSVC 2008.
Here are the modifications (based on the extracted zip file root):
Replace line 306 of include/config-win.h with:
// avoid annoying warning
#ifndef HAVE_COMPRESS
# define HAVE_COMPRESS
#endif
Comment lines 350-367 of CMakeLists.txt (CPack instructions cause CMake to fail)
Follow instructions in BUILD.win
I have installed asterisk latest package and using mysql DB for realtime simulation. But in the CLI i am getting the error:
config.c:2444 find_engine: Realtime mapping for 'sippeers' found to engine 'mysql', but the engine is not available
and while executing command MODULE LOAD RES_CONFIG_MYSQL i am getting the following message.
loader.c:918 load_resource: Module 'RES_CONFIG_MYSQL' could not be loaded.
My machine is with linux mint 16. 64 bit.
If you have version <1.4 you have download asterisk-addons and compile it too
Otherwise you have do
make menuconfig
before make and select mysql addon
So, I've tried everything I can do right now, not really getting anywhere with this, so I am turning to the guys on SO for some assistance.
System Details:
Fedora 17 x86_64
Intel® Pentium(R) Dual CPU E2160 # 1.80GHz × 2
1.9 GiB memory
KCacheGrind 0.7.1
KDE Platform Version 4.9.4
Procedure Details:
I get an XDEBUG log from the server or from a Chrome Ext called Xdebug Helper. And I run it, either directly from the icon or from a Shell Script I created.
#!/bin/bash
export $(dbus-launch)
kcachegrind
And I get an error "No Profile Data Loaded"
Any ideas?
SORRY: error reads "(No function selected)"
Forgive me. I am a n00b at Linux and KCacheGrind.
I used root. Fixed. Adding 10 or more characters.
Trying to install RMySQL on 64-bit Windows 7.
Using R-2.14.2 with Rtools214 and MySQL Server 5.5.
Read through several step-by-steps of RMySQL source installation.
Troubleshooting:
- Copied libmysql.dll to R-2.14.2/bin AND R-2.14.2/bin/i386.
- Copied libmysql.dll and libmysql.lib to MySQL Server 5.5\lib\opt.
- Entered MYSQL_HOME=C:\Program Files\MySQL\MySQL Server 5.5 into Renviron.site, saved to R\R-2.14.2\etc.
My instances of common problems:
Sys.getenv('MySQL_HOME')
[1] "C:\Program Files\MySQL\MySQL Server 5.5\"
install.packages('RMySQL', type = 'source')
Installing package(s) ...
...
RS-DBI.c:1:0: sorry, unimplemented: 64-bit mode not compiled in
make: [RS-DBI.o] Error 1*
ERROR: compilation failed for package 'RMySQL'
...
I'm guessing my problem lies in the '64-bit mode...' message, but I'm not sure.
Thoughts?
I'm not sure this error message has anything to do with RMySQL, or any particular package.
On 64bit Windows, instead of the default PATH :
C:\Rtools\MinGW\bin
( gives the error sorry, unimplemented: 64-bit mode not compiled in )
you might (quite reasonably) notice the MinGW64 directory alongside and try :
C:\Rtools\MinGW64\bin
but in fact it needs to be :
C:\Rtools\gcc-4.6.3\bin
Then of course, stop and start a new DOS window to pick up the new PATH.
I had problems installing RMySQl
so I installed the package RODBC which works fine.
(make sure the MySQL driver is installed).
http://dev.mysql.com/downloads/connector/odbc/