51

In SQL, I know I can do:

UPDATE TableA SET MyColumn=NULL

But, how do I enter NULL into a cell graphically? I tried entering 'null' and 'NULL' and '' (nothing/empty string) into the MySQL Query Browser with no success.

vvvvv
  • 25,404
  • 19
  • 49
  • 81
rlb.usa
  • 14,942
  • 16
  • 80
  • 128

10 Answers10

76
  1. Switch to edit mode
  2. Right click on field
  3. Choose "Clear field content"
Praveen Kumar Purushothaman
  • 164,888
  • 24
  • 203
  • 252
a1ex07
  • 36,826
  • 12
  • 90
  • 103
  • 3
    And just to add for anyone else finding this, this only works if there's something in the field. If you already tried just deleting the contents, this won't work until you put something back in the cell. Then this solution will work. – Tom Collins Mar 27 '13 at 14:06
  • 20
    As of MySQL Workbench 6.0.8, the option has been changed to "Set Field(s) to NULL". – Xynariz May 14 '15 at 21:37
  • 15
    I could not get this to work until I realized that if the cursor is already in the field, the menu won't have "Set Field(s) to NULL". Click outside of the field, then right click the field to get the correct menu. – Alien Technology Aug 30 '16 at 23:53
  • 1
    I think in newer Workbench version the same option is labeled as "Set Field(s) to NULL" – Anuj Jul 20 '20 at 00:08
22

MySQL Workbench 5.4.42: Terribly buggy, but if you try a couple of times, right-clicking the cell while in Edit mode should give you the option Set Field(s) to NULL.

DEL, Ctrl+0 or similar doesn't work.


In Workbench 6.3 the buggy UI has been fixed. Don't forget to click the Apply button to actually execute the resulting UPDATE statement.

Gruber
  • 4,478
  • 6
  • 47
  • 74
10

Use SHIFT + DEL buttons when clicking on the field that you want to set as NULL.

Peter
  • 1,589
  • 2
  • 20
  • 27
7

Right Click on the cell and you will find there 'set field(s) to NULL'.

Jay
  • 671
  • 9
  • 10
4

Google returned:

You can right-click on a cell and choose "Clear Field Content" in the popup menu. It will set the cell value to NULL.

To Add: if you are in edit mode you get a different context menu, make sure you are NOT in edit mode on the cell you want to set to NULL

Community
  • 1
  • 1
Mitch Dempsey
  • 38,725
  • 6
  • 68
  • 74
1

If it helps, there's a workaround (as I'm using Workbench 6.3 and dont see any 'Set Field(s) to NULL'!) ...

Copied the SQL statement from the preview, cancel the 'Update' dialog box, manually changed the '' values to NULL and ran that query manually.

peedeeaay
  • 116
  • 1
  • 7
1

if you can't find in MYSQLWORKBENCH ('set field(s) to NULL'.) then just goto phpmyadmin select database find your column cell and click to check box NULL it will be set as NULL.

Abnormal
  • 11
  • 6
0

Yet another workaround. Workbench 6.3. Change field to say an empty string and click Apply. In the 'Review the SQL script' dialog change SET field='' to SET field=NULL and click Apply.

mp31415
  • 6,531
  • 1
  • 44
  • 34
0

On Workbench 8, use just Del key

KBIIX
  • 873
  • 9
  • 14
-1

In HeidiSql, you can insert NULL by clicking on a cell, and then Ctrl+Shift+N.

live-love
  • 48,840
  • 22
  • 240
  • 204