Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.017 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'postgresql': 0.05; 'subject:Error': 0.05; 'whatever.': 0.07; 'corresponds': 0.09; 'figuring': 0.09; 'null,': 0.09; 'unsigned': 0.09; 'received:209.85.214.174': 0.13; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'helps!': 0.16; 'syntactic': 0.16; 'syntax': 0.16; 'wed,': 0.17; 'wrote:': 0.18; 'int': 0.18; 'jan': 0.19; 'pointed': 0.21; 'header:In-Reply-To:1': 0.22; 'int,': 0.23; 'suggests': 0.23; 'bit': 0.28; 'message- id:@mail.gmail.com': 0.28; 'problem': 0.29; 'error': 0.29; 'pm,': 0.29; 'server': 0.30; 'ahead.': 0.30; 'chris': 0.30; "i'll": 0.31; 'version': 0.32; 'actual': 0.32; 'error.': 0.32; 'received:209.85.214': 0.32; 'there': 0.33; 'to:addr:python-list': 0.34; '"you': 0.37; 'received:google.com': 0.37; 'references': 0.38; 'some': 0.38; 'received:209.85': 0.38; 'getting': 0.38; 'primary': 0.38; 'skip:\xa0 10': 0.39; 'received:209': 0.40; 'to:addr:python.org': 0.40; '8bit%:8': 0.40; 'hope': 0.61; 'your': 0.61; 'kind': 0.61; 'back': 0.62; '2012': 0.67; '11,': 0.68; 'yourself': 0.69; 'database.': 0.74; 'length:': 0.84; 'look,': 0.84; 'often,': 0.84; 'spoiler': 0.84; 'naked': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=kpRINMVYVjsCVJDn6re0RnFIsDiAf542foNGoXL/xD0=; b=qvcdp3M4KnEX1nrTJA198nH+wi38J8H6y+tAYh661O+6kphTl1VMBCotW30v16ABAc YMxOsGJKM82bw/NTJKTFzDLYa6j1rDyIzuTE78rUg24w3nQe7TBJKWwHWJEvPYehV3jm PhNCKSawtjNgpA8k8IXMipi5krShCMK0WgssQ= MIME-Version: 1.0 In-Reply-To: References: Date: Wed, 11 Jan 2012 20:00:07 +1100 Subject: Re: MySQLdb Error From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 51 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1326272411 news.xs4all.nl 6843 [2001:888:2000:d::a6]:50523 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:18811 On Wed, Jan 11, 2012 at 6:57 PM, Emeka wrote: > CREATE TABLE AddressTables ( AddressTables_id int (9) unsigned > primary key auto_increment not null, =A0city_name char(40) , =A0state_nam= e > varchar, =A0street_number int, =A0country_name varchar, =A0street_name ch= ar(40) , > user_name char(40) references usertables(name)) > > _mysql_exceptions.ProgrammingError: (1064, "You have an error in your SQL > syntax; check the manual that corresponds to your MySQL server version fo= r > the right syntax to use near ' =A0street_number int, =A0country_name varc= har, > =A0street_name char(40) , user_name ch' at line 1") You're getting an error back from the database. The message suggests that you look around the place cited for some kind of syntactic error. See if you can find the error; often, in situations like this, the actual error is a little bit before what's pointed to. Have a look, I'll wait. Spoiler alert! Try figuring it out yourself before you scroll down. You've been warned! There are spoilers ahead. Okay. The problem is that MySQL requires varchar to be followed by a length: varchar(255) or varchar(32) or whatever. The use of naked 'varchar' is a PostgreSQL feature only. Hope that helps! Chris Angelico