How to make a field NULL using MySQL GUI Tools?

2019-01-26 02:48发布

问题:

I'm using the MySQL Query Browser (part of the MySQL GUI Tools) and need to change a field to NULL, but I can't figure out how to do it - if I delete the value it tries to update it to ''. Typing "NULL" makes it try to update to 'NULL' (a string).

I know I could just write a query to do it, but that defeats the entire purpose of the tool, no?

回答1:

In MySQL Query Browser, right click on the cell and select 'Clear field content' while the focus is in another cell.

In MySQL Workbench, right click on the cell and select 'Set Field to NULL'.



回答2:

In MySQL Workbench, with the cell selected, press Shift + Delete

Tested on 6.3.4.0



回答3:

Removing the contents:

This works for some tools (sorry to hear it doesn't for yours). This may not appear as null but will when you perform a query.



回答4:

I'd try Ctrl-0 (zero), because that works in some tools.