Class Magento\Catalog\Model\Product\Attribute\Backend\Media does not exist

Fix the error “Class Magento\Catalog\Model\Product\Attribute\Backend\Media does not exist”

Backend-Media-does-not-exist
The exception fired while you save a new product.

This error hapended when you upgrade Magento from 2.0.x to Magento 2.1.x, or use the data migration tool. Because this class was remove in Core file

Commit change:

https://github.com/magento/magento2/commit/0f0063045b50e1dafa260b97a1a00bf9fa92e74b#diff-7efc962fb113e767187c2ce8d5017415

So, to fix this error, just run the SQL command below to update your database struct.

UPDATE `eav_attribute` SET `backend_model` = NULL, `backend_type` = 'static'  WHERE `attribute_code` = 'media_gallery'