# Rake aborted.. Mysql error

**URL:** <https://www.ruby-forum.com/t/rake-aborted-mysql-error/127211>\
**Category:** Rails\
**Created:** [January 26, 2008, 8:20am UTC](https://www.ruby-forum.com/t/rake-aborted-mysql-error/127211 "2008-01-26T08:20:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![stranger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8edcca/32.png) [@stranger](https://www.ruby-forum.com/u/stranger)\
**Post date:** [January 26, 2008, 8:20am UTC](https://www.ruby-forum.com/t/rake-aborted-mysql-error/127211/1 "2008-01-26T08:20:34Z")

</div>

Hi,

I am following a tutorial using the acts\_as\_authenticated plugin. I  
created a new project and created a controller today and then  
installed the authentication plugin. I ran the rake db:migrate.

# == CreateUsers: migrating

– create\_table(“users”)  
rake aborted!  
Mysql::Error: You have an error in your SQL syntax; check the manual  
that corresponds to your MySQL server version for the right syntax to  
use near ‘datatime DEFAULT NULL) ENGINE=InnoDB’ at line 1: CREATE  
TABLE users (`id` int(11) DEFAULT NULL auto\_increment PRIMARY KEY,  
`login` varchar(255) DEFAULT NULL, `email` varchar(255) DEFAULT NULL,  
`crypted_password` varchar(40) DEFAULT NULL, `salt` varchar(40)  
DEFAULT NULL, `created_at` datetime DEFAULT NULL, `updated_at`  
datetime DEFAULT NULL, `remember_token` varchar(255) DEFAULT NULL,  
`remember_token_expires_at` datetime DEFAULT NULL, `activation_code`  
varchar(40) DEFAULT NULL, `activated_at` datatime DEFAULT NULL)  
ENGINE=InnoDB

(See full trace by running task with --trace)

My migration file is:

def self.up  
create\_table “users” do |t|  
t.column :login, :string  
t.column :email, :string  
t.column :crypted\_password, :string, :limit =\> 40  
t.column :salt, :string, :limit =\> 40  
t.column :created\_at, :datetime  
t.column :updated\_at, :datetime  
t.column :remember\_token, :string  
t.column :remember\_token\_expires\_at, :datetime  
t.column :activation\_code, :string, :limit =\> 40  
t.column :activated\_at, :datatime  
end  
end

There is no column with id as rails already creates one. Please help  
me in this issue. I am using rails 1.2.6 with MYSQL 5.2.0 beta on a  
Mac OSX tiger.

---

<div class="post-metadata">

**Author:** ![stranger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8edcca/32.png) [@stranger](https://www.ruby-forum.com/u/stranger)\
**Post date:** [January 26, 2008, 10:45am UTC](https://www.ruby-forum.com/t/rake-aborted-mysql-error/127211/2 "2008-01-26T10:45:23Z")

</div>

On 26/01/2008, stranger [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> rake aborted!  
> ENGINE=InnoDB  
> t.column :salt, :string, :limit =\> 40  
> me in this issue. I am using rails 1.2.6 with MYSQL 5.2.0 beta on a  
> Mac OSX tiger.

try use restful\_authentication plugin instead  
[http://agilewebdevelopment.com/plugins/restful\_authentication](http://agilewebdevelopment.com/plugins/restful_authentication)

> **[\#67 restful\_authentication - RailsCasts](http://railscasts.com/episodes/67-restful-authentication)**
>
> Short Ruby on Rails screencasts containing tips, tricks and tutorials. Great for both novice and experienced web developers.

i’m wondering also why you use that old migration from that old plugin  
where you can now do sexy automatic migration like t.timestamps for  
created\_at and updated\_at fields from new plugin (same plugin  
author/technoweenie)

> 

–  
r9 = { name: Rie!, ym: riyari3, skype: rubyninja,  
li: [http://linkedin.com/in/ariekeren](http://linkedin.com/in/ariekeren),  
fb: [Buy Real Facebook Likes | Pay for FB Likes - Profile.to](http://profile.to/ariekeren),  
blog: [http://tinyurl.com/2bjgvn](http://tinyurl.com/2bjgvn) }

---

<div class="post-metadata">

**Author:** ![stranger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8edcca/32.png) [@stranger](https://www.ruby-forum.com/u/stranger)\
**Post date:** [January 26, 2008, 1:24pm UTC](https://www.ruby-forum.com/t/rake-aborted-mysql-error/127211/3 "2008-01-26T13:24:21Z")

</div>

On 26 Jan 2008, at 07:19, stranger wrote:

> Hi,
> 
> I am following a tutorial using the acts\_as\_authenticated plugin. I  
> created a new project and created a controller today and then  
> installed the authentication plugin. I ran the rake db:migrate.  
> t.column :activated\_at, :datatime  
> Should of course be :datetime 🙂

Fred

---

<div class="post-metadata">

**Author:** ![stranger](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/8edcca/32.png) [@stranger](https://www.ruby-forum.com/u/stranger)\
**Post date:** [January 26, 2008, 6:35pm UTC](https://www.ruby-forum.com/t/rake-aborted-mysql-error/127211/4 "2008-01-26T18:35:34Z")

</div>

Thank you for the reply… I was just following the book. The  
migration ran smoothly for Sqlite3 database, but the problem still  
exists for the mysql database… I dont understand why???

On Jan 26, 4:23 am, Frederick C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
