Showing posts with label delete. Show all posts
Showing posts with label delete. Show all posts

Sunday, April 1, 2012

MySQLWorkbench - error on DELETE, UPDATE


Sample query –
Delete from MyDB.SourceUrls

Error -
Error Code: 1175 You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column

Here is the solution -
By default MySQL editor runs in Safe Mode, which means it restrict users from comprehensive delete and update operation. You need to put the where clause in your query. You can follow any of below steps to avoid the error -

1. Add SET SQL_SAFE_UPDATES=0; before your update query. -
SET SQL_SAFE_UPDATES=0;
Delete from MyDB.SourceUrls

2. Follow below steps –
MySQLWorkbench > Preferences > SQL Editor > Query Editor
uncheck option – “Safe Updates”. Forbid UPDATEs and DELETEs with no key in WHERE clause or no LIMIT clause.

Sunday, February 12, 2012

Some Useful mac commands


  • Check the disk space - df 
  • Is your system 32-bit or 64-bit - uname -a
  • Update environment variables like windows - vi ~/.bash_profile
  • Load the environment variables - source ~/.bash_profile
  • Run program under admin - sudo



In mac, there is no explicit delete button like windows.

Fn + backspace - "del" key (delete letter to the right)
Alt + backspace - Delete last word
Command + backspace - Delete whole line