you can do it from mysql and as well as custom script .
- Mysql Way (magento 2)
open your database and go to table
customer_entity the password is stored in column
here you need to enter the query like
UPDATE `customer_entity`SET `password_hash` = CONCAT(SHA2('xxxxxxxxadmin@123', 256), ':xxxxxxxx:1') WHERE `entity_id` = 810
here admin@123 is the password that we assigned and 810 is the customer id (named as entity_id under customer entity), please change it according to your requirement . also dont remove xxxxx , it is needed
let me know if it works for you , we can also change it via custom script , let me know if you need it .