LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 06-03-2015, 11:24 PM   #1
Huamin
Member
 
Registered: May 2011
Posts: 562

Rep: Reputation: 12
Problem with Update, on Mysql


Hi,
what is the reason to the following problem

17:07:56 update t2 set system='VG' where system='OK' Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Editor and reconnect. 0.000 sec

got, using MySql?
 
Old 06-04-2015, 03:01 AM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
The error message gives all info you need. For this query you have to disable safe mode in /etc/my.cnf. The other solution would be to use a primary KEY column in the where clause.
 
Old 06-04-2015, 03:58 AM   #3
Huamin
Member
 
Registered: May 2011
Posts: 562

Original Poster
Rep: Reputation: 12
Sorry, I still get this error

16:56:25 update t2 set system='VG' where id in(89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 136) and system='OK' Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Editor and reconnect. 0.000 sec

I also have got this

17:16:40 update t2 set system='VG' where id in(89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 136) Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Editor and reconnect. 0.000 sec

And how to resolve this

18:29:47 update t3 set userid='845343' Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Editor and reconnect. 0.000 sec

as well?

BTW, how to retrieve the table's definition, within Workbench? I mean the way to re-create the same table, within Mysql?

Last edited by Huamin; 06-04-2015 at 05:34 AM.
 
Old 06-04-2015, 10:12 AM   #4
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
what does this give out:
update t2 set system='VG' where id = 89

Quote:
18:29:47 update t3 set userid='845343' Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Editor and reconnect. 0.000 sec
There is no where condition at all! Do you want to reset all userids?

Last edited by j-ray; 06-04-2015 at 10:14 AM.
 
Old 06-04-2015, 07:37 PM   #5
Huamin
Member
 
Registered: May 2011
Posts: 562

Original Poster
Rep: Reputation: 12
Even if I've put one where clause to the query, I still get this

17:16:40 update t2 set system='VG' where id in(89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 136) Error Code: 1175. You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column To disable safe mode, toggle the option in Preferences -> SQL Editor and reconnect. 0.000 sec

why?
 
Old 06-05-2015, 03:52 AM   #6
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu, mint, suse
Posts: 1,591

Rep: Reputation: 145Reputation: 145
Quote:
why?
because, obviously, mysql running in safe mode behaves like this
 
  


Reply



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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Mysql does not autostart though I have added mysql to 'insserv / rc update' rockhopper_penguin Linux - Newbie 1 06-22-2014 10:04 AM
[SOLVED] Is there any problem with mysql in 13.0 64 last update? ethereal1m Slackware 9 04-29-2010 06:55 AM
How do I update mysql? ivj Linux - Software 7 06-30-2006 02:00 AM
Strange problem with PHP5/MySQL update function gabebster Programming 9 04-06-2006 11:48 PM
UPdate of MySQL 3.23.58 to 4.0 Fredstar Linux - Newbie 2 10-17-2004 12:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration