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

Equality and Equity: A Journey That Starts at Home, Beyond the Workplace!

In 2023, during the celebration of International Women's Day, I encountered the notion of " Equity " for the first time. Initially, its significance in a woman's daily life didn't strike me profoundly. However, over the past year, I've been continually reminded of its relevance on numerous occasions. Discussions around workplace Diversity and the concerted effort to elevate the presence of women in organizations, especially in leadership roles, have gained traction globally. While commendable, there's a touch of irony in this commendable endeavor. The very men who wield decision-making power in organizations, shaping policies to foster inclusivity and gender balance, often seem to leave the concept of equality at their home doorstep. As they enter their domestic realm, they discard the notion of equality as if shedding a coat, anticipating their wives to effortlessly shift from their professional roles into the responsibilities of a homemaker. It's imp...

A lot can happen over coffee....only if you are allowed to sit at a CCD outlet!

Cafe Coffee Day is no more a new name for the youngsters in India. For a warm cup of coffee at an affordable price, thats where we generally go to! But more than the cup of coffee, its the atmosphere of Café Coffee Days which attracts all of us. An informal setup...good beverage and snacks...soothing music (most of the time)...complimentary wi-fi (at many outlets)...well, CCD always had a lot to offer its customers. Photo source - https://www.zomato.com/pune/cafe-coffee-day-2-koregaon-park For Siddhartha, coffee always used to be an experience to be offered...not just beans to be grown. I have had my job interview conducted at a CCD outlet. I have hosted and attended several community meetups at different CCD outlets across the country. I have even had my coffee dates at CCDs. Well, truely, a lot has happened in my life over coffee...at different CCD outlets. Once, Siddhartha himself had spent his new year's eve, serving customers at a Café Coffee Day (CCD) outlet near C...

Afterall its Paris...

My after event blog posts are generally a report of the event...if you are looking for a report of the MDN Work-week, this is not the right post. This post is a complete non-technical and non-work oriented story of how I fell in love in and with Paris. A glance of Paris...  Paris had been a dream of mine for quite a long time, and the first time I got the invitation for MDN Workweek, I kind of knew this one was going to be awesome! Paris is beautiful...way more beautiful than my words can ever express. Every moment of this one weekend feels like a long, beautiful dream. Everything is too perfect here. This city has a weird kind of "intoxication" in its air. The more you breadth in the cool air, the more you fall in love with this city. The weather here couldn't probably be any better...its perfectly cool....not too hot, not too cold. Refreshing cool breeze just washes away all your worries and stress. Someone couldn't probably be upset in this city...its aw...