So this morning I was trying to connect to a mysql database in a rails app. I’ve actually been dealing with Rails for quite a while now without needing a database, so it had been awhile since I had last connected. So I setup a database, edit my database.yml file and BLAM!, it breaks and I get some call about a libmysql.dll that is missing. I assumed that this must be becuase I don’t have the correct rails or mysql gems installed, so I tried updating those, then tried removing everything and reinstalling, still the same problem.
Finally I found the solution, the libmysql.dll file is located in the bin directory of your mysql installation. There also needs to be a copy of it in the Ruby\bin directory. I’m not sure what is supposed to magically copy that over, but following the steps on all the install HowTo’s there was never any mention of it. So after copying the file over everything is working fine and dandy. So just in case you get in this pickle, here is your solution.
October 6, 2006 at 6:22 pm |
You shouldn’t have to copy the file over. Just add “C:\mysql\bin” (or wherever your mysql/bin dir is located) to your Windows system path (environment variables) and reboot your system.
October 6, 2006 at 6:38 pm |
I actually had the mysql\bin in my system path and it wasn’t working until I copied it over. Another guy I know had the same issue and moving the file worked for him.
November 11, 2006 at 8:46 pm |
You rock man! It worked…
November 15, 2006 at 1:12 pm |
very glad that it helped, I was so frustrated when I got stuck on it
June 7, 2007 at 2:49 am |
OMG THAT HELPED TY!
June 23, 2007 at 6:33 am |
thanks bud, spent the last half hour looking for the reason that was playing up.
January 9, 2008 at 4:15 am |
Thank you.
I had this same problem. Placing the file in Windows\System32 didn’t work. I can’t explain why, but putting the file right in ruby\bin works great.
January 25, 2008 at 6:12 am |
That did the trick. I had the path correct in my environment path variable and still it could not see it. Copying the file libmysql.dll from mysql/bin to ruby/bin directory did the trick.
Thanks
August 19, 2008 at 6:08 pm |
Thanks a bunch, you saved me a couple hours. That’s a lot of dev time. Thanks!
August 21, 2008 at 6:32 am |
Hi,
I’m trying to understand where to locate the ruby/bin directory.
I tried to locate it under: C:\Program Files\MySQL\MySQL Server 5.0
but it didn’t help.
can you help?
Thanks!
August 21, 2008 at 2:07 pm |
the ruby/bin directory is located wherever you installed Ruby at on your machine, the default is c:/ruby
September 9, 2008 at 11:36 pm |
I’m using windows vista and ruby 1.8.6 and I didn’t need to copy the file. It worked puting the path as an enviromment variable.
Thanks!
September 27, 2008 at 2:08 pm |
I solved mine by adding libmysql.dll to system32, however, I noticed that my database is no more predictable. When I run some like rake install at the console, it runs rake db:migrate inside the rakefile which creates tables(this is printed on the development log), however , when I check my database , I would not find any tables.
November 24, 2008 at 7:44 pm |
It did work! Thank you very much!
November 30, 2008 at 1:18 am |
UR da man! Thanks very much!
December 8, 2008 at 7:32 am |
thank you ver much dude!!
December 18, 2008 at 8:08 am |
Thanks!!
December 21, 2008 at 8:48 am |
[...] cant find libmySQL.dll when I test in the browser. So heres the tricky part. I finally found on hillemania blog that you have to manually copy the libmySQL.dll file [...]
January 16, 2009 at 9:49 am |
Thanks for your post. I have the same problem, but with your information I have can save this error. Thanks again
January 30, 2009 at 6:41 pm |
Thanks for your help! It works. Saves me a lot of time! bless you
March 26, 2009 at 5:45 am |
Thanks for your suggestion I spent countless hours finding a solution for this problem, it finally worked after I copied that file to the ruby\bin directory…Thanks a lot!!!!
March 31, 2009 at 1:10 pm |
podaa paradesi
April 24, 2009 at 12:58 pm |
Had and still have the same problem with Ruby on Windows. I had copied to system32 and whatever – working unstable. I tried lots of cases even without %path% variables and I noticed (with using filemon.exe) that Ruby works with mysql.so (v.2.7.3) library and it works awfully unstable: samotime it appeared to work and enother one not. I this main problem is mysql.so.
May be anybody knows how to compile sources to get this library working in system.
May 17, 2009 at 10:53 pm |
[...] à faire. Il faut copier-coller le fichier libmysql.dll du dossier mysql vers le dossier ruby/bin. Merci à ce post pour m’avoir aidé sur ce coup [...]
May 21, 2009 at 6:32 am |
Thanks a lot!!!! Its works fine
May 29, 2009 at 8:51 am |
[...] de datos falla porque falta un archivo, tras una breve búsqueda doy a la primera con la solución: http://hillemania.wordpress.com/2006/09/21/rails-mysql-50-on-windows-setup-problemfix-libmysqldll/#c... Todo va bien de momento y creo el blog del manual. He conseguido completar el blog. Me gusta ROR! [...]
June 18, 2009 at 9:13 am |
Thank you very much.. now it works very fine….
June 30, 2009 at 2:40 pm |
Thanks a lot! I use Mac or Linux most of the time and this blog save me a lot of time to get rails up and running on Widows.
July 26, 2009 at 5:50 pm |
Thanks a lot for this solution. It really helped. Amazing that you contributed to this vast oceans of beignners…. Thanks again!
Cheers