Skip to main content

RMySQL troubleshooting in Ubuntu

RMySQL package installation is no longer as easy as it used to be with the previous versions. The simple install.packages("RMySQL") no longer works like a magic! 
If you try this command on your latest R version, you are likely to get the following errors:

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."


I have found the solution to this problem. You can also try this and see if your problem is being solved.

Some simple steps are:
  • Get mysql-connector-c-6.0.2-linux-glibc2.3-x86-64bit from this link here
  • Un-tar the contents in your downloaded folder.
  • There you will get two folders- 'library' and 'include'.  
  • on your /usr/local/include folder you will need to copy the contents of the 'library' and 'include' folder (copy the contents in the 'include' and 'library' folders respectively). 
  • inside your /usr/local/include folder, you will need to make a new directory "mysql" and there need to run the following commands:
    • cp -R '/home/username/Downloads/mysql-connector-c-6.0.2-linux-glibc2.3-x86-64bit/include/.' '/usr/local/lib64/R/include/.'  
    • cp -R '/home/username/Downloads/mysql-connector-c-6.0.2-linux-glibc2.3-x86-64bit/lib/.' '/usr/local/lib64/R/lib/.'
  •  After this, try the command  R CMD INSTALL MySQL_0.9-3.tar.gz (or whichever version you have downloaded.
  • After all of these processes are done, switch to your R console and try library(RMySQL). If you get the "Loading required package: DBI", your job is done!
Notes: 
You will need to install these other packages as well:
  • sudo apt-get install r-cran-rmysql
  • sudo apt-get install r-cran-dbi
Hope this helps. If there are errors in this or if you have a better solution to this, please share that in comments.

Comments

Popular posts from this blog

Quarantining Alone - A Once in a Lifetime Opportunity

This Covid-19 virus has turned the entire world upside down. It has broken a lot of older habits and set a lot of new normals. Towards the early days of this lockdown, I had written a blog - An Extrovert in Isolation . The early lockdown days were extremely difficult for me. That was the phase of breaking old habits. An extrovert by nature, couldn't accept the sudden change of being locked alone inside my house. I am writing this blog again after being locked at home for more than 100 days now. Most of the older habits are broken by now. A few new habits have become a part of my new normal. What seemed to have been painful 100 days back has now turned to be blissful. Here, I am sharing my story of how quarantining alone has ended up being the greatest opportunity and a huge transformation in my life.  I have been struggling for years to fix my sleep patterns. Going to bed late and waking up late had been a habit for a really long time. My struggles to change this habit had

RASCI model - the responsibility assignment matrix

In the last few days, both at my workplace as well as while dealing with a few activities around me, I have realized the importance of implementing a better responsibility assignment matrix, to get things done in a less messed up way. A few months back, during some random conversation, a friend of mine had introduced me to the RASCI model, one of the responsibility assignment matrices. Wikipedia says that the responsibility assignment matrix 'describes the participation by various roles in completing tasks or deliverables for a project or business process.'  In simple words, for any project, if we can divide each person's role and responsibility, it not only ensures a better end product, but also saves the time, otherwise lost in discussions (which organizations like to call as meetings). A RASCI implementation ensures that each person is responsible for only and only the task assigned to him (or her) and will not need to interfere with another person's task, un

The stranger in Pain

I have just returned from Malaysia today. After a 3 months stay in Singapore, I could finally make it to Malaysia, Kuala Lampur. Just a small 3 days trip with my friends. On the second day of our trip, we had decided to visit the Genting Highlands. Early morning we started off for the adventurous trip, only three of us- Sree Lakshmi(my room mate in Singapore), Nishita(my co-scholar from SCMS-UG) and me. We boarded our bus to Genting. Sree and Nishi sat together and I sat alone, taking a window seat. After a while, an elderly uncle, Indian looking, of about the age of 60+, occupied the vacant seat next to mine.  He initiated the conversation by asking me which country I am from. After I answered that I was from India, he said he was from Sri Lanka. My thinking of him being an Indian was proven wrong. He was a very friendly man. After the initial ice breaking, we started speaking about ourselves and our lives. He told that he had finished conquering the entire globe with just some 4 co