You don't *need* a primary key on a table.  You don't a key on a table
at all, if that's what you want.

You can turn off this error message without altering your table by
specifying --safe-updates=0 when you start the mysql client.  This
option apparently is turned on by default in 4.x.  The point of the
option is to stop people from doing silly things like "delete from
<table>" without a WHERE clause.

Dean Harding

-----Original Message-----
From: Alan McDonald [mailto:alan@;meta.com.au] 
Sent: Sunday, 10 November 2002 12:04 pm
To: 3mip1s4la-Emilio Pisanty
Cc: MySQL Mailinglist
Subject: RE: little problem, I need some help...

Every SQL database requires the ability to locate a record which is
unique
in some way. You can't have two records which look the same.
That's why you need to define a primary KEY on a column or coumns.
You need to read a primer on SQL databases

Alan


> -----Original Message-----
> From: 3mip1s4la-Emilio Pisanty [mailto:emipisala@;lancaster.edu.mx]
> Sent: Sunday, 10 November 2002 11:34
> To: R. Hannes Niedner
> Cc: MySQL Mailinglist
> Subject: Re: little problem, I need some help...
>
>
>
> > > tables have met with a 1175 error ("You are using safe update
> mode and you
> > > tried to update a table without a WHERE that uses a KEY column").
> > Nothing is obvious and is hard to advise you if you don't give
> us some more
> > info on the table structure and the update query you have trouble
with.
> >
> > /h
>
> ok. thable structure is this:
> mysql> describe pupils;
> +----------+-------------+------+-----+---------+-------+
> | Field    | Type        | Null | Key | Default | Extra |
> +----------+-------------+------+-----+---------+-------+
> | name     | varchar(20) | YES  |     | NULL    |       |
> | surname  | varchar(20) | YES  |     | NULL    |       |
> | surname2 | varchar(20) | YES  |     | NULL    |       |
> | form     | char(3)     | YES  |     | NULL    |       |
> | tutor    | varchar(20) | YES  |     | NULL    |       |
> | sex      | char(1)     | YES  |     | NULL    |       |
> | birth    | date        | YES  |     | NULL    |       |
> | math     | char(3)     | YES  |     | NULL    |       |
> | optA     | char(3)     | YES  |     | NULL    |       |
> | optB     | char(3)     | YES  |     | NULL    |       |
> +----------+-------------+------+-----+---------+-------+
> 10 rows in set (0.00 sec)
>
> it was built in version 3.23, and we recently updated to 4.0.4 beta.
>
> the query I'm running is
>
> mysql> UPDATE pupuils SET tutor = 'URIOSTEGUI' WHERE group = 'U6U';
> (setting the name of the tutor for Upper 6)
>
> and I meet with:
> ERROR 1175: You are using safe update mode and you tried to
> update a table
> without a WHERE that uses a KEY column
>
> I don't quite understand what a "KEY column" is, can someone
> explain it to
> me? if you can't answer, where can I find error listings? because they
> don't appear to be on the site.
>
> hope this helps you help me...
>
> thanks in advance,
>
>    Emilio Pisanty
>
>
>
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail
<[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to