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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

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