# Help! Error occurs while creating db schema for MySQL 5.0 us

**URL:** <https://www.ruby-forum.com/t/help-error-occurs-while-creating-db-schema-for-mysql-5-0-us/91446>\
**Category:** Rails\
**Created:** [April 9, 2007, 11:32am UTC](https://www.ruby-forum.com/t/help-error-occurs-while-creating-db-schema-for-mysql-5-0-us/91446 "2007-04-09T11:32:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![allen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/bbce88/32.png) [@allen](https://www.ruby-forum.com/u/allen)\
**Post date:** [April 9, 2007, 11:32am UTC](https://www.ruby-forum.com/t/help-error-occurs-while-creating-db-schema-for-mysql-5-0-us/91446/1 "2007-04-09T11:32:20Z")

</div>

Hi all,

I’m creating the db schema for MySQL 5.0 using migration but run into  
error. My migration file is as follows:

class CreateCustomers \< ActiveRecord::Migration  
def self.up  
create\_table :customers do |t|  
t.column :id, :integer, :null =\> false  
t.column :name, :string  
end  
end

def self.down  
drop\_table :customers  
end  
end

And the error information is:

# == CreateCustomers: migrating

– create\_table(:customers)  
rake aborted!  
Mysql::Error: #42000You have an error in your SQL syntax; check the  
manual that corresponds to your MySQL server version for the right  
syntax to use near ‘(11), `name` varchar(255) DEFAULT NULL)  
ENGINE=InnoDB’ at line 1: CREATE TABLE customers (`id` int(11) DEFAULT  
NULL auto\_increment PRIMARY KEY(11), `name` varchar(255) DEFAULT NULL)  
ENGINE=InnoDB

I’ve never seen this error before. What’s wrong with my migration file  
or develop env? How could I solve this? Thanks a lot.

---

<div class="post-metadata">

**Author:** ![allen](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/bbce88/32.png) [@allen](https://www.ruby-forum.com/u/allen)\
**Post date:** [April 9, 2007, 12:36pm UTC](https://www.ruby-forum.com/t/help-error-occurs-while-creating-db-schema-for-mysql-5-0-us/91446/2 "2007-04-09T12:36:25Z")

</div>

> class CreateCustomers \< ActiveRecord::Migration  
> def self.up  
> create\_table :customers do |t|  
> t.column :id, :integer, :null =\> false  
> t.column :name, :string  
> end  
> end  
> id column generates automatically 😉
