MySQL driver for Rails in Windows 7 x64

前端 未结 10 1639
长发绾君心
长发绾君心 2020-12-23 14:46

I\'ve got problem with connecting to MySQL database on my freshly installed Windows 7 machine. I\'m getting this error when I try to migrate my database.

!!!         


        
相关标签:
10条回答
  • 2020-12-23 15:38

    I am new to this rails. I just have passed the same issue in vista. after downloading libmySQL.dll (in the PATH) with the one from InstantRails it starts working.

    sukumaaar@gmail.com

    0 讨论(0)
  • 2020-12-23 15:43

    Adding the libmySQL.dll from InstantRails to a dir in my path worked for me too. It's really sad that we have to do this sort of thing though. I'd like to see the gem, or MySql itself, install this DLL properly.

    0 讨论(0)
  • 2020-12-23 15:46

    For Rails or DataMapper or whatever to talk to MySQL you need a 32-bit driver in Rails\bin. The driver is called libmysql.dll. Even if you have a 64-bit server you need a 32-bit driver.

    64-bit driver will fail will ruby/gems/1.8/gems/do_mysql-0.10.2-x86-mingw32/lib/do_mysql/1.8/do_mysql.so: 193: %1 is not a valid Win32 application.

    A wrong 32-bit version will crash with memory allocation error or something weird like that (suggested solution to take libmysql.dll from another project may not work with newer versions of MySQL).

    0 讨论(0)
  • 2020-12-23 15:49

    My colleague had a similar problem while running rails on Windows 7. He had to replace the libmySQL.dll (in the PATH) with the one from InstantRails.

    0 讨论(0)
提交回复
热议问题