'MySQL - How do I enter NULL?

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.



Solution 1:[1]

  1. Switch to edit mode
  2. Right click on field
  3. Choose "Clear field content"

Solution 2:[2]

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.

Solution 3:[3]

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

Solution 4:[4]

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

Solution 5:[5]

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

Solution 6:[6]

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.

Solution 7:[7]

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.

Solution 8:[8]

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.

Solution 9:[9]

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

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Praveen Kumar Purushothaman
Solution 2
Solution 3 Peter
Solution 4 Jay
Solution 5 Community
Solution 6 peedeeaay
Solution 7 Abnormal
Solution 8 mp31415
Solution 9 live-love