# Login\_engine - rake migrate error, "ENGINE=InnoDB"

**URL:** <https://www.ruby-forum.com/t/login-engine-rake-migrate-error-engine-innodb/51953>\
**Category:** Engines\
**Created:** [January 9, 2006, 5:48pm UTC](https://www.ruby-forum.com/t/login-engine-rake-migrate-error-engine-innodb/51953 "2006-01-09T17:48:08Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![brad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/59ef9b/32.png) [@brad](https://www.ruby-forum.com/u/brad)\
**Post date:** [January 9, 2006, 5:48pm UTC](https://www.ruby-forum.com/t/login-engine-rake-migrate-error-engine-innodb/51953/1 "2006-01-09T17:48:08Z")

</div>

Hi,

I followed all the instructions at  
[http://api.rails-engines.org/login\_engine/](http://api.rails-engines.org/login_engine/) and successfully installed  
and used the Login\_Engine with a local MySQL database instance.

However, when I did exactly the same (slightly different app, but same  
mods and all–using the same instructions), but with a _remote_ MySQL  
instance, I receive the following error when attempting to do the  
migration:

Migrating engine ‘login\_engine’  
rake aborted!  
Mysql::Error: You have an error in your SQL syntax near ‘ENGINE=InnoDB’  
at line 1: CREATE TABLE users (`id` int(11) DEFAULT NULL auto\_increment  
PRIMARY KEY, `login` varchar(80) DEFAULT ‘’ NOT NULL, `salted_password`  
varchar(40) DEFAULT ‘’ NOT NULL, `email` varchar(60) DEFAULT ‘’ NOT  
NULL, `firstname` varchar(40), `lastname` varchar(40), `salt`  
varchar(40) DEFAULT ‘’ NOT NULL, `verified` int(11) DEFAULT 0, `role`  
varchar(40), `security_token` varchar(40), `token_expiry` datetime,  
`created_at` datetime, `updated_at` datetime, `logged_in_at` datetime,  
`deleted` int(11) DEFAULT 0, `delete_after` datetime) ENGINE=InnoDB

Anyone have any ideas / clues as to what is wrong?

Thank you very much!

~ Brad

---

<div class="post-metadata">

**Author:** ![brad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/59ef9b/32.png) [@brad](https://www.ruby-forum.com/u/brad)\
**Post date:** [January 9, 2006, 6:16pm UTC](https://www.ruby-forum.com/t/login-engine-rake-migrate-error-engine-innodb/51953/2 "2006-01-09T18:16:46Z")

</div>

Is the version of your remote MySQL server different to the local one?  
That chunk of SQL runs fine on my local MySQL instance too…

- james

---

<div class="post-metadata">

**Author:** ![brad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/59ef9b/32.png) [@brad](https://www.ruby-forum.com/u/brad)\
**Post date:** [January 10, 2006, 6:18am UTC](https://www.ruby-forum.com/t/login-engine-rake-migrate-error-engine-innodb/51953/3 "2006-01-10T06:18:30Z")

</div>

James A. wrote:

> Is the version of your remote MySQL server different to the local one?  
> That chunk of SQL runs fine on my local MySQL instance too…

Thanks James. I did figure out that I am using MySQL 5.0.16 (locally)  
and the remote version is (was) 3.23… and that that old version must  
use the ‘TYPE=InnoDB’ modifier, not ‘ENGINE=InnoDB’ modifier! So, after  
much mucking about in Rake and elsewhere grepping, I couldn’t find out  
how to change the engine\_migrate script to use the “old” syntax (how to  
do that would be an interesting ‘side question’ but anyway), so we  
upgraded the (remote) MySQL instance to 4.1.19.

Now, however, we’re getting the following error:

Mysql::Error: Lost connection to MySQL server during query: SELECT  
version FROM  
engine\_schema\_info WHERE engine\_name = ‘login\_engine’

And looking in the mysql log file we see:

[Warning] mysql.user table is not updated to new password format;  
Disabling new password usage until mysql\_fix\_privilege\_tables is run

We seem to be able to log on the the new 4.1.19 version with our GUI  
tools (or from the command line) just fine and execute commands, but no  
go from login\_engine. I guess I’m thinking to reinstall everything,  
unless I get any other clues. Disappointing because everything went so  
smoothly on my local instance of MySQL.

Any more ideas on how to get this thing to sing? Does it require MySQL  
5.x to run the login\_engine?

Thanks again,  
Brad

---

<div class="post-metadata">

**Author:** ![brad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/59ef9b/32.png) [@brad](https://www.ruby-forum.com/u/brad)\
**Post date:** [January 10, 2006, 10:57am UTC](https://www.ruby-forum.com/t/login-engine-rake-migrate-error-engine-innodb/51953/4 "2006-01-10T10:57:21Z")

</div>

I dont’ think your issue has anything to do with the login engine or  
plugins, but rather Rails itself connecting with your database. Wasn’t  
there some kind of password scheme change between MySQL 4 and 5? The  
important error message seems to be “[Warning] mysql.user table is not  
updated to new password format;” - perhaps this page might help?

[http://wiki.rubyonrails.com/rails/pages/MySQL+Database+access+problem](http://wiki.rubyonrails.com/rails/pages/MySQL+Database+access+problem)

FYI, the login\_engine doesn’t require any particular database, it only  
requires that Rails’ own migrations operate properly.

- james

---

<div class="post-metadata">

**Author:** ![brad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/59ef9b/32.png) [@brad](https://www.ruby-forum.com/u/brad)\
**Post date:** [November 8, 2006, 8:03am UTC](https://www.ruby-forum.com/t/login-engine-rake-migrate-error-engine-innodb/51953/5 "2006-11-08T08:03:21Z")

</div>

The quickest way to fix the MySQL 3.x problem is to find this file  
(mysql\_adapter.rb) and change the line that says:

super(name, {:options =\> “ENGINE=InnoDB”}.merge(options))

to this:

super(name, {:options =\> “TYPE=InnoDB”}.merge(options))

I found this little trick here:  
[http://dev.rubyonrails.org/ticket/6382](http://dev.rubyonrails.org/ticket/6382)

---

<div class="post-metadata">

**Author:** ![brad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/59ef9b/32.png) [@brad](https://www.ruby-forum.com/u/brad)\
**Post date:** [January 12, 2006, 9:27pm UTC](https://www.ruby-forum.com/t/login-engine-rake-migrate-error-engine-innodb/51953/6 "2006-01-12T21:27:36Z")

</div>

Right you were:

James A. wrote:

> I dont’ think your issue has anything to do with the login engine or  
> plugins, but rather Rails itself connecting with your database.

But it wasn’t a password problem as you were guessing, James, it seemed  
to be some other problem with the build of the mysql adapter for Windows  
(in Ruby or Rails) that was the problem.

Just for the record, in case others have this problem, what I did was  
download a compresssed .RAR file for mysql 4.1.15 (mysql-ruby-win32.rar)  
and copied it as instructed in the readme at this link:

[http://jeroen.concept-q.biz/files/](http://jeroen.concept-q.biz/files/)

This did the trick… I’ve spent more than 3 days pulling my hair out  
(as well as my business partner who’s also lost some hair as well–plus  
he hates it when I pull his hair ;-), but didn’t discover this link  
until just now.

EVERYONE: If you are getting ANY kind of MySQL::Error, in particular  
what I was getting was variations of this:

Mysql::Error: Lost connection to MySQL server during query [. . .]

(Buried deep in a stack trace from Rails–this wasn’t occuring for a  
local instance of MySQL server, but only when it was running on a remote  
server–in our case on a 1&1 dedicated host that we self-manage. Of  
course the adapter worked fine from the server itself AND it worked fine  
from a Mac OS X box running the identical Ruby/Rails/login\_engine code  
against this remote MySQL server, but always got the error above when  
running from my Windows XP SP 2 box.)

Anyway, if you have this problem, try going to the above URL and  
download the .RAR file there (you may need to download WinACE or  
something similar to read .rar compressed files), then read the  
readme.txt located within and copy the file where it directs.

Note: This is no longer an “ENGINE=InnoDB” problem, hence I’ve renamed  
the Subject: line of this reply…

Good luck!

~ Brad

---

<div class="post-metadata">

**Author:** ![brad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/59ef9b/32.png) [@brad](https://www.ruby-forum.com/u/brad)\
**Post date:** [October 27, 2007, 1:02pm UTC](https://www.ruby-forum.com/t/login-engine-rake-migrate-error-engine-innodb/51953/7 "2007-10-27T13:02:20Z")

</div>

Louis wrote:

> The quickest way to fix the MySQL 3.x problem is to find this file  
> (mysql\_adapter.rb) and change the line that says:
> 
> super(name, {:options =\> “ENGINE=InnoDB”}.merge(options))
> 
> to this:
> 
> super(name, {:options =\> “TYPE=InnoDB”}.merge(options))
> 
> I found this little trick here:  
> [http://dev.rubyonrails.org/ticket/6382](http://dev.rubyonrails.org/ticket/6382)

I just typed “ENGINE=InnoDB” in Google and got there… This trick  
solved my problem and thanks for help!

---

<div class="post-metadata">

**Author:** ![brad](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/59ef9b/32.png) [@brad](https://www.ruby-forum.com/u/brad)\
**Post date:** [July 2, 2009, 9:16am UTC](https://www.ruby-forum.com/t/login-engine-rake-migrate-error-engine-innodb/51953/8 "2009-07-02T09:16:34Z")

</div>

brad wrote:

> Hi,
> 
> I followed all the instructions at  
> [http://api.rails-engines.org/login\_engine/](http://api.rails-engines.org/login_engine/) and successfully installed  
> and used the Login\_Engine with a local MySQL database instance.
> 
> However, when I did exactly the same (slightly different app, but same  
> mods and all–using the same instructions), but with a _remote_ MySQL  
> instance, I receive the following error when attempting to do the  
> migration:
> 
> Migrating engine ‘login\_engine’  
> rake aborted!  
> Mysql::Error: You have an error in your SQL syntax near ‘ENGINE=InnoDB’  
> at line 1: CREATE TABLE users (`id` int(11) DEFAULT NULL auto\_increment  
> PRIMARY KEY, `login` varchar(80) DEFAULT ‘’ NOT NULL, `salted_password`  
> varchar(40) DEFAULT ‘’ NOT NULL, `email` varchar(60) DEFAULT ‘’ NOT  
> NULL, `firstname` varchar(40), `lastname` varchar(40), `salt`  
> varchar(40) DEFAULT ‘’ NOT NULL, `verified` int(11) DEFAULT 0, `role`  
> varchar(40), `security_token` varchar(40), `token_expiry` datetime,  
> `created_at` datetime, `updated_at` datetime, `logged_in_at` datetime,  
> `deleted` int(11) DEFAULT 0, `delete_after` datetime) ENGINE=InnoDB
> 
> Anyone have any ideas / clues as to what is wrong?
> 
> Thank you very much!
> 
> ~ Brad

I’d the same problem. I fixed it changing MySQL configuration file,  
enabling InnoDB.  
The ‘mysql.ini’ file had a line which reads ‘skip-innodb’  
I deleted that line, restarted mysql and voilÃ¡! now migrations run  
without any problem at all

JoaquÃ­n Vicente
