I'm trying to add a new customer in magento admin, after creating the credentials I can't seem to log in as per there is no password field upon creating.

Can anybody tell me how to add a new customer in magento 2 either via mysql or in magento admin.


  • What's the issue in creating customer from admin? Commented Feb 22, 2019 at 6:26
  • for creating the password you can simply use the forgot password option at the front-end & get the new password generation link to your email & generate the password from there! Commented Feb 22, 2019 at 6:29

2 Answers 2


you can do it from mysql and as well as custom script .

  1. Mysql Way (magento 2)

open your database and go to table customer_entity the password is stored in column password_hash enter image description here

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 .


In latest M2 you cant add any kind of PW for customer, to do so for testing you have to create customer from admin and to change its PW run the following query in mysql:

UPDATE `customer_entity`
SET `password_hash` = CONCAT(SHA2('xxxxxxxxpassword', 256), ':xxxxxxxx:1')
WHERE `entity_id` = 145;

Let me know if you still have any issue ? 145 is customer id in my case and after xxxxxxxx 'password' will be your new password

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.