Error: 1175 SQLSTATE: HY000 (ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE) Message: You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column
This error denotes that UPDATE conflicts with the safe mode setting as set in the MySQL daemon. To fix, edit your .cnf file to disable safemode and then restart mysqld in the server OS environment. On Feb 8, 2011, at 9:15 PM, Fogelson, Steve wrote: > Hi Ben, > > I received this error when running the following > > •Error: 1175 SQLSTATE: HY000 (ER_UPDATE_WITHOUT_KEY_IN_SAFE_MODE) > Message: You are using safe update mode and you tried to update a table > without a WHERE that uses a KEY column > > UPDATE Products SET P_Name = REPLACE(P_Name,'FISH-FRY MINNOW®','FISH-FRY > MINNOW™') WHERE P_Name LIKE '%FISH-FRY MINNOW®%'; > > The following worked and displayed the proper replacements in seven rows, but > I need to move this from just a display to an UPDATE > > SELECT REPLACE(P_Name,'FISH-FRY MINNOW®','FISH-FRY MINNOW™') FROM > Products WHERE P_Name LIKE '%FISH-FRY MINNOW®%'; > > I tried numerous variations of the UPDATE sql, but with no luck. Any ideas > would be appreciated. > > Thanks > > Steve > From: Ben Johansen [mailto:[email protected]] > Sent: Tuesday, February 08, 2011 4:17 PM > To: [email protected] > Subject: Re: Witango-Talk: Looking for a little SQL help (OT) > > try replace() > > http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_replace > > UPDATE Category SET Cat_Name = replace(Cat_Name,'®',‘™’) WHERE > Cat_Name LIKE ‘%®%’; > > On Feb 8, 2011, at 1:55 PM, Fogelson, Steve wrote: > > > Hi, > > Database is MySQL. Having a brain fart today. I want to update all > occurrences of ® to ™ in a field, but leave the rest of the field > intact. > > I believe this would set the filed to ™ > > UPDATE Category SET Cat_Name = ‘™’ WHERE Cat_Name LIKE ‘%®%’; > > Thanks > > Steve Fogelson > > > To unsubscribe from this list, please send an email to [email protected] > with "unsubscribe witango-talk" in the body. > > Ben Johansen > http://www.webspinr.com > [email protected] > Phone: 360-597-3372 > Mobile: 360-600-7775 > > > > > To unsubscribe from this list, please send an email to [email protected] > with "unsubscribe witango-talk" in the body. > To unsubscribe from this list, please send an email to [email protected] > with "unsubscribe witango-talk" in the body. Ben Johansen http://www.webspinr.com [email protected] Phone: 360-597-3372 Mobile: 360-600-7775 ---------------------------------------- To unsubscribe from this list, please send an email to [email protected] with "unsubscribe witango-talk" in the body.
