MySQL Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsDatabasesMySQL Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 4th, 2013, 02:37 PM
BoldonKen BoldonKen is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2013
Posts: 3 BoldonKen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 40 m 38 sec
Reputation Power: 0
Create Table, MYSQL 5.5, Syntax Error

I am a complte Newbie to Ubuntu and MySQL.

I have manged to Instal Ubuntu, MYSQL Server and MYSQL Navigator.

Using Navigator I am attempting to create a table.

I get Syntax Error

The SQl generated by MYSQL Navigator is:

CREATE TABLE MyTable (
Field1 TINYINT NULL,
Field2 TINYINT NULL
) TYPE = MyISAM COMMENT ='';

Can anyone give me any assistance?

Reply With Quote
  #2  
Old March 5th, 2013, 01:45 AM
vestlink vestlink is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2013
Posts: 7 vestlink User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 56 m 12 sec
Reputation Power: 0
Quote:
Originally Posted by BoldonKen
I am a complte Newbie to Ubuntu and MySQL.

I have manged to Instal Ubuntu, MYSQL Server and MYSQL Navigator.

Using Navigator I am attempting to create a table.

I get Syntax Error

The SQl generated by MYSQL Navigator is:

CREATE TABLE MyTable (
Field1 TINYINT NULL,
Field2 TINYINT NULL
) TYPE = MyISAM COMMENT ='';

Can anyone give me any assistance?


What error do you get?

Try this:

CREATE TABLE `mytable` (
`field1` tinyint(4) DEFAULT NULL,
`field2` tinyint(4) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


I think your error lies in that you have not defined the range of tinyint


And since you are a newcomer to mysql i would suggest that u use some kind of frontend/gui to access mysql, e.g. Tora or squirrel or even Heidi sql

Nicolai

Reply With Quote
  #3  
Old March 5th, 2013, 03:55 AM
r937's Avatar
r937 r937 is offline
SQL Consultant
Click here for more information.
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 26,373 r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 1 Week 2 Days 6 h 53 m 41 sec
Reputation Power: 4140
Quote:
Originally Posted by vestlink
I think your error lies in that you have not defined the range of tinyint
sorry, no

the (4) is an optional designator which indicates how many digits to print when you are using ZEROFILL

the range of TINYINT (as with all integer columns) is predefined

original poster did not actually say what the error message was, but i'm going to guess it's cause by using TYPE instead of ENGINE
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book

Reply With Quote
  #4  
Old March 5th, 2013, 04:04 AM
vestlink vestlink is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2013
Posts: 7 vestlink User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 56 m 12 sec
Reputation Power: 0
Quote:
Originally Posted by r937
sorry, no

the (4) is an optional designator which indicates how many digits to print when you are using ZEROFILL

the range of TINYINT (as with all integer columns) is predefined

original poster did not actually say what the error message was, but i'm going to guess it's cause by using TYPE instead of ENGINE


Ok. I also learned something new today :-) thnx

Nicolai

Reply With Quote
  #5  
Old March 5th, 2013, 10:42 AM
BoldonKen BoldonKen is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2013
Posts: 3 BoldonKen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 40 m 38 sec
Reputation Power: 0
Quote:
Originally Posted by r937
sorry, no

the (4) is an optional designator which indicates how many digits to print when you are using ZEROFILL

the range of TINYINT (as with all integer columns) is predefined

original poster did not actually say what the error message was, but i'm going to guess it's cause by using TYPE instead of ENGINE


Sorry, I did say the error was "Syntax Error", the message was slightly longer, it actually said "Syntax Error near TYPE"

As I explained I was using MYSQL Navigator to generate the SQL, the parameter folllowing TYPE is chosen from a Combobox list.

I am not actually at my Ubuntu box / MYSQL Server box at the moment, I will try your suggestions and respond ASAP.

Thank You

Reply With Quote
  #6  
Old March 5th, 2013, 12:35 PM
BoldonKen BoldonKen is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2013
Posts: 3 BoldonKen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 40 m 38 sec
Reputation Power: 0
OK, I changed the SQL to say ENGINE instead of TYPE, and it worked.

So, first of all thank you for that.

Am I being silly by asking, "why does MySQL's own GUI tool produce the wrong SQL?

Reply With Quote
  #7  
Old March 5th, 2013, 12:56 PM
r937's Avatar
r937 r937 is offline
SQL Consultant
Click here for more information.
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 26,373 r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level)r937 User rank is General 47th Grade (Above 100000 Reputation Level) 
Time spent in forums: 3 Months 1 Week 2 Days 6 h 53 m 41 sec
Reputation Power: 4140
Quote:
Originally Posted by BoldonKen
Am I being silly by asking, "why does MySQL's own GUI tool produce the wrong SQL?
no, you are not

TYPE used to be valid in early versions of mysql

perhaps you have an early version of navigator

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMySQL Help > Create Table, MYSQL 5.5, Syntax Error

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap