I am working on R under CentOS 6.7, and I need to gain access to a MySQL database. I successfully downloaded and installed the two packages "DBI" and "RMySQL", but whenever I try to load the library into the R script, I get an error message that RMySQL does not exist.
Error in library(RMySQL) : there is no package called ‘RMySQL’
I tried the exact same thing on another CentOS 7 server and it didn't work. However, when I try it on my local Windows 7 machine it worked perfectly fine.
Related
I am trying to run 0x-api, locally. I followed instructions (https://github.com/0xProject/0x-api#getting-started), however, while running yarn db:migrate, I am getting following error:
Error during migration run:
MissingDriverError: Wrong driver: "undefined" given. Supported drivers are: "cordova", "expo", "mariadb", "mongodb", "mssql", "mysql", "oracle", "postgres", "sqlite", "better-sqlite3", "sqljs", "react-native", "aurora-data-api", "aurora-data-api-pg".
Software info:
postgres#14
m1 mac
forked latest 0x-api code.
What I tried?
I thought there might be some installation issues with postgres so I have reinstalled postgres in my local machine (m1 mac). Tried to connect it with pgAdmin portal via localhost. and its working.
Checked 0x-api code for default driver setting, but no where it has been explicitly mentioned.
Check postgres server, but its running fine.
I even tried on AWS ubuntu server, but getting same error.
I am not sure if this anything related to postgres server.
Ok, I've spent all day on this, and I am stuck, so I'm going to ask for help.
I previously installed Delphi 11 Enterprise in a virtual machine, and also installed MySQL 8.0.27 (64-bit). After obtaining some 32-bit MySQL dlls I was able to easily connect to my database using the FireDAC MySQL driver and from the Data Explorer in the Delphi IDE.
I have now created a new VM and installed both Delphi 11.1 Enterprise and MySQL 8.0.28. After exporting my database from the previous VM, and importing it into this new MySQL server, I tried to attach to the database using FireDAC. Using the same parameters as in the last VM, and the same dlls copied to C:\Windows\SysWOW64, testing the connection fails and produces the following error:
[FireDAC][Phys][MySQL] SSL connection error: unknown error number
I've compared the parameters for connecting to the two databases between the two VMs, and they are the same. And, the connections in MySQL to the two databases also appear to be the same.
One thing that is odd (and I think I know why) is that in the VM where the connection fails, if I view the Info tab of the FireDAC Connection Editor, it says it is using libmysql.dll in the c:\Windows\System32 folder (there's no such file in that folder). But that is also true from the Connection Editor in the VM where FireDAC successfully connects, so I am assuming that System32 is being mapped to C:\Windows\SysWOW64.
If anyone can affirm that they are successfully connecting to MySQL 8... using Delphi 11.1 and FireDAC, and can offer a suggestion for what I need to fix, I will be grateful.
= = = = = = = = = = = = == = = = = = = = =
Update: I've uninstalled MySQL 8.0.28, and reinstalled it using the Development Computer template. I still cannot connect to MySQL using the FireDAC Connection Editor, but I can connect at runtime so long as I employ an FDPhysMySQLDriverLink component, and set the VendorLib property to either libmariadb.dll or libmysql.dll, the 32-bit versions that are stored in the C:\Windows\SysWOW64 folder (thanks Ian Barker for your sample code!). I'm still working on this, since I really want to connect from the IDE, but at least I've had some success.
I have had the same issue today, as part of a whole batch of problems with mysql not running so I updated it and then hit the error above.
My 64 bit Delphi 10.3 Programs would not connect at all - so I changed the physical driver to libmariadb.dll and that has resolved the issue.
Be sure from where your app is loading the libmysql.dll by calling h:= loadlibray('libmysql.dll') /without path/ and then GetModulePath(h) to see its full path.
Remember that Delphi is 32bit and it needs to use 32bit version of lobmysql.dll while a 64bit compiled program would need the same bitbness.
This was nuts. I installed and uninstalled MySQL (and MySQL Workbench and MySQL Script) probably 10 times. The last install worked. I have no idea why this was necessary.
My working laptop is Mac OS X 10.11.3 El Capitan. I am currently working on a project in which I am developing a shiny app to visualize the data in our company's MySQL database. I set up the SSH Tunnel via 'SSH Tunnel Manager' and was able to connect MySQL data via SquelPro. However, I am constantly having problems when I am trying to connect MySQL data in R (R-version3.2.3 / Rstduio-version 0.99.491) using 'RODBC' package.
Initially, I am following this blog: http://blog.nguyenvq.com/blog/2013/04/06/guide-to-accessing-ms-sql-server-and-mysql-server-on-mac-os-x/ to downloaded and created the connector and 'odbc.ini' files. Then move them to the right locations.
Yet, when I try to install package 'RODBC' in R, the installation process fails and returns the following error message - "configure: error: "ODBC headers sql.h and sqlext.h not found". Then I follow the steps in this link to downloaded the iODBC zip files: Installation of RODBC/ROracle packages on OS X Mavericks Yet, I couldn't identify the file 'libiodbc.a' in the archball. So, just moving the sql.h and sqlext.h files are not helping. I still have that issue.
So, I found another link: Installation of RODBC on OS X Yosemite which says installing unixODBC will also solve this issue. So I copied the commands and successfully downloaded unixODBC. This time it works. I successfully called the library(RODBC) in R. However, when I run the following R commands in Rstudio:
connect1 <- odbcConnect(dsn="mysql01",
uid="user_name",
pwd="pass_words")
Then I got error message like:
Warning messages:
1: In odbcDriverConnect("DSN=mysql01;UID=user_name;PWD=pass_words") :
[RODBC] ERROR: state IM002, code 0, message [unixODBC][Driver Manager]Data source name not found, and no default driver specified
2: In odbcDriverConnect("DSN=mysql01;UID=user_name;PWD=pass_words") :
ODBC connection failed
It seems that I need to configure the driver manager for unixODBC on R. However, I am not sure what exactly gone wrong in the process above. What should I do next to get R connected to MySQL?
I am attempting to connect R to a MySQL database via RODBC (in Win 7 environment), but cannot get past the following error:
[RODBC] ERROR: state IM014, code 0, message [Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application
After entering the following command:
odbcConnect(dsn,uid="My_UID",pwd="My_PWD")
I have successfully created a driver for the database by following the odbc wizard, and have installed the RODBC package into RStudio (ver 0.98.490). The MySQL is running on 32bit, I have the 32bit driver installed and working, and my RStudio is also 32bit. I know that the driver is working since both the test connection in config. works, as do queries run on excel using the driver.
What can I do to get the connection to work in R?
(Previous responses to this question seem to have been removed.)
Thanks in advance!
I faced a similar RODBC connectivity issue using DSN, where R was crashing abruptly without any logs/error trace. I tried with DSN-less ODBC connection API, it works fine.
odbcDriverConnect("SERVERNAME=;DRIVER={};DATABASE=;UID=;PWD=;")
Steps:
1. Install ODBC driver
2. Define VNode (host, listen address, protocol)
3. Use the odbcDriverConnect API
Docs:
http://cran.r-project.org/web/packages/RODBC/RODBC.pdf
http://cran.r-project.org/web/packages/RODBC/vignettes/RODBC.pdf
Hope this helps.
R version 3.0.2 (2013-09-25)
Platform: x86_64-w64-mingw32/x64 (64-bit)
I've used RMySQL since , and recently I formatted my computer and now
trying to install RMySQL again.
But in this time, I installed MySQL Server on other hard drive, not on C:\
I did everything i know, the things when installing RMySQL before,
and I got the result like this on R-studio console.
(I installed MySQL Server on E:, and installed R, Rtools, Rstudio on C:)
...
Error : .onLoad failed in loadNamespace() for 'RMySQL', details:
call: fun(libname, pkgname)
error: Cannot find a suitable MySQL install
ERROR: loading failed
...