I have been getting this error message from MySQL
ERROR 1175 (HY000): You are using safe update mode and you tried to update a table without a WHERE that uses a KEY column.
The query I use is this:
update custcopy set cust_contact=null where cust_id='1000000005';
The information about the MySQL I use is "Ver 8.0.32 for Win64 on x86_64 (MySQL Community Server - GPL)". And the scheme of the table I accessed is as follows:
+--------------+-----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+--------------+-----------+------+-----+---------+-------+
| cust_id | char(10) | NO | | NULL | |
| cust_name | char(50) | NO | | NULL | |
| cust_address | char(50) | YES | | NULL | |
| cust_city | char(50) | YES | | NULL | |
| cust_state | char(5) | YES | | NULL | |
| cust_zip | char(10) | YES | | NULL | |
| cust_country | char(50) | YES | | NULL | |
| cust_contact | char(50) | YES | | NULL | |
| cust_email | char(255) | YES | | NULL | |
+--------------+-----------+------+-----+---------+-------+
I consulted the mysql documentation and found that this statement may be helpful, but I don't quite understand why.
I need a query that would not cause that error, and disabling the SQL_SAFE_UPDATES is not an option.