If you failed to create a new product from admin and you’ll get an error message something like this
SQLSTATE: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`cataloginventory_stock_item`, CONSTRAINT `FK_CATALOGINVENTORY_STOCK_ITEM_STOCK` FOREIGN KEY (`stock_id`) REFERENCES `cataloginventory_stock` (`stock_id`) ON DELETE CASCADE ON UPDATE)
You have to check whether you deleted entry from cataloginventory_stock table. If yes then please use below query to add new product.
INSERT INTO cataloginventory_stock SET stock_name = ‘Default’;
I faced this issue, might be helpful to others.