- Posts: 6
COMMUNITY FORUM
K2 _ users empty
- Mikael Blomk
-
Topic Author
- Offline
- New Member
after moving my website to a new server, I can not login to my Joomla Backend. The table k2_users is empty, when I look into my MySQL database.
How can I insert a new admin user via MySQL into this table? Or can I do something else?
Do you have any ideas?
Thank you!
Mik
Please Log in or Create an account to join the conversation.
- olsen
-
- Offline
- Elite Member
- Joomla and K2 Freelancer
Try this.
first execute this SQL command to add a new user to the users table
INSERT INTO `#_users`(`name`, `username`, `email`, `password`, `block`, `sendEmail`, `registerDate`, `activation`) VALUES ('newadmin','newadmin','[email protected]','433903e0a9d6a712e00251e44d29bf87:UJ0b9J5fufL3FKfCc0TLsYJBh2PFULvT','0','1','2013-12-15 00:00:00','0')
Write down the new user id created and then we add that user to the mapping table where assign it to the admin user group, by default id = 8. Change XX for the user id created.
INSERT INTO `#_user_usergroup_map`(`user_id`, `group_id`) VALUES ('XX','8')
Remember to change the #_ value for the prefix used in your joomla DB in both querys.
After that you can access with the following data:
user: newadmin
pass: admin
Hope it helps
Regards
Didn't solve your issues?? Why dont you consider hire me? Email me or contact me www.xevedigital.com for details
Please Log in or Create an account to join the conversation.
- Mikael Blomk
-
Topic Author
- Offline
- New Member
- Posts: 6
thank you for your answer. Unfortunately it is not working. When I want to login I get the message that I don't have access to the administration area of this website.
When I try to login with my admin data from my old server, I get the message that the user or the password is wrong or that this user does not exist...
:( Do you have any other ideas?
Thank you!
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
You can try either restoring an older backup or moving the user related DB tables.
Please Log in or Create an account to join the conversation.
- Mikael Blomk
-
Topic Author
- Offline
- New Member
- Posts: 6
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
It is important that you maintain the same DB structure.
PS. You will have to update your K2 items if they do no have an author. Which in this case applies to all of your items, since your DB does not have any users.
Please Log in or Create an account to join the conversation.
- Mikael Blomk
-
Topic Author
- Offline
- New Member
- Posts: 6
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
You can try backing up and then importing the user tables ( xx_users, xx_usergroups etc)
from a new Joomla! installation.
Please Log in or Create an account to join the conversation.
- olsen
-
- Offline
- Elite Member
- Joomla and K2 Freelancer
Just saying, Did you check if is set the right DB in your configuration.php file?? Maybe you are trying to edit the wrong DB.
Didn't solve your issues?? Why dont you consider hire me? Email me or contact me www.xevedigital.com for details
Please Log in or Create an account to join the conversation.
- Mikael Blomk
-
Topic Author
- Offline
- New Member
- Posts: 6
But now I inserted public $root_user='admin'; into the last row of the configuration.php
Now I can login with the emergency mode. I created a new super user, but when I log out and delete the root_user row from the config and want to login with this new super user (or the old one from the emergency mode) it doesn't work.
I have no idea what's going on here :(
Do you have some other ideas?
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.
- Mikael Blomk
-
Topic Author
- Offline
- New Member
- Posts: 6
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
I think you only have one option. Setup a new site and migrate the content if all of the above have failed.
Please Log in or Create an account to join the conversation.