wp search-replace inside site’s directory bring PHP fatal error

The source of the problem was unchanged (or shall I say, “adjusted”) wp-config.php file in the site’s directory.

The DB-name and DB-username there where both outdated. I changed them to the new ones and than I ran the command successfully.