Jump to content
Pierre10

Create superadmin via command line

Recommended Posts

Hello,

Is there a way to create a new SuperAdmin via commands ? (mysql, php-cli, ...)

Thank you.

Share this post


Link to post
Share on other sites

you can if you have database access via mysql command. You need to create an entry in ps_employee, then query for its id and create one in ps_employee_shop, setting the role to 1

Share this post


Link to post
Share on other sites

I can run mysql commands. Some questions :

In ps_employee_shop, to set an admin role, I just have to set ps_shop to 1 ?

How to create a new entry the correct way ? Is it something like that ?

INSERT INTO `db`.`ps_employee` (`id_employee`, `id_profile`, `id_lang`, `lastname`, `firstname`, `email`, `passwd`) VALUES ('2', '1', '1', 'New', 'Admin', 'newadmin@domain.com', 'NEWPASSWORD');

INSERT INTO 'db'.'ps_employee_shop' ('id_employee', 'id_shop') VALUES ('2', '1');

Thank you.

 

Share this post


Link to post
Share on other sites

id_profile should be 1, id_shop should be your shop id, could be null, 0, or 1, or another number if you have multiple shops. Check the other entries and just conform to that. Use a real email, you will need to reset your password before you can access

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More