Problem description
MySQL databases can be connected, and rails configurations related to MySQL are normal.
HoweverProgramWhen accessing the database, the following error message is displayed on the server:
Argumenterror (NULL pointer given ):
(Eval): 3: In 'Each _ hash'
(Eval): 3: In 'all _ hashes'
....
Or
Run the following command in the rials project directory:Rake DB: migrate -- TraceThe following error occurs when the command imports the database structure:
Rake aborted!
MySQL: Error: Query: not connected: Create Table 'schema _ migrations '('version' varchar (255) not null) engine = I
Nnodb
Solution:
This is because the libmysql. dll in mysql5.x is incompatible with rails (at least 2.3.5 ). You can download an old version of libmysql. dll from the Internet and put it in the ruby bin directory.
:
Http://instantrails.rubyforge.org/svn/trunk/InstantRails-win/InstantRails/mysql/bin/libmySQL.dll
You can also download it from here:
Libmysql