I can not log in with admin.
Asked by Willam Won:

I can not log in with admin.aa.PNG  
[](https://community.atlassian.com/t5/Confluence-questions/I-can-not-log-in-with-admin/qaq-p/245580?attachment-id=2812){#link_11891c3687abc5}  
[](/tnckb94959/attachments/tnckb94959/confluence-questions/41513/1/aa.PNG){#display_11891c3687abc5_0}


Answers:
author: Nic Brough -Adaptavist-
body: Right. What I would do here:

1. Sack the person who allowed HSQL to be used in production - Why have all the warnings in the documentation, the installation and the admin screens been ignored? The reason HSQL is not used in production is that it can fail, spectacularly and without warning. You can lose chunks of data or the whole lot in one go without ever finding any reason why. Mostly, it doesn't. Sometimes, it does and you usually end up having to start from scratch, having lost everything. \<end rant\>
2. Stop Confluence
3. Find the file called "database.script"
4. Take a copy of it and put it somewhere safe
5. Open the page that Alex Conde pointed you to earlier - that has instructions on setting the password in the database, and you'll need the password stuff from it
6. Open the database.script file in a TEXT editor (don't try to use an IDE or a word processor, they might try to be clever, you must load and save this as text)
7. Somewhere in it, you will find a line like: INSERT INTO CWD_USER VALUES(10000,1,'admin','admin',1,'2011-07-01 12:23:16.808000000','2011-07-01 12:23:16.808000000','','','','','admin','admin','admin@[example.com](http://example.com)','admin@[example.com](http://example.com)','{PKCS5S2}WRcV6qyUqFl6rlpHFfVakNvc7RPu2XLkk+jSGHlnnOhcj0NowWUPH8Z0RcZSSP2O',NULL)
8. You need to change that line in your file so that the password and number of login attempts are set according to what the docmentation says - your file may have different values for id, username and so-on, do NOT amend them - you're only interested in the password hash and the number of failed attempts to log in.
9. Restart Confluence
10. Export the data to xml
11. Shut down Confluence
12. Put it on a supported database
13. Import the XML
14. Let the users back in

<br />

If steps 2 - 9 do not work, then the next option is to stop Confluence, and dig up the regular exports it makes by default (if you have the automatic backups enabled), and rebuild Confluence from that. If you don't have that enabled, then you should look for the backups of the database.script you should have been taking - you can simply put an older version over the current one. Then you can try to merge any changes that were in database.script, but the amount of rescuable data depends on how damaged the database is.  

<br />

<br />

If none of those work, then I'm afraid your next option is to get your users to export anything they can see in their spaces to XML and import them into a new Confluence.  

1.  
1.  

comments: author: Willam Won
body: i can't find file called "database.script", only find the file called "confluencedb.properties".


author: Nic Brough -Adaptavist-
body: I'm terribly sorry, I was thinking of JIRA hsql there, and got confuddled.Look for a file called confluencedb.script not database.script.


author: Nic Brough -Adaptavist-
body: Check the whole installation too - it seems to wander around in different systems. Sometimes it's under the "home" directory for the application, in others the whole dataset lives under home/database


author: Willam Won
body: I changed "{PKCS5S2}a1RfPs1DbG87nDPpF7VT2BfAUorEtOsy0OnIcPUu3KmH5m9YLtTdJxhNAe0DmQxb" to "x61Ey612Kl2gpFL56FT9weDnpSo4AV8j8+qx2AuTHdRyY036xxzTTrw10Wq3+4qQyB+XURPWx1ONxp3Y3pB37A==", and restart Confluence.But it can not login by admin.What can i do?


author: Nic Brough -Adaptavist-
body: You've lost the {PKCS5S2} off it there. And did you remember to set the failed login count to 0?


author: Alejandro Conde Carrillo
body: Hi William.

If you forgot your admin password, you can follow the procedure in [Restoring Passwords To Recover Admin User Rights](https://confluence.atlassian.com/display/DOC/Restoring+Passwords+To+Recover+Admin+User+Rights).

comments: author: Willam Won
body: i can't connect hsql with DbVisualizer,The confluence server installed in linux,how to connect hsql?


author: Nic Brough -Adaptavist-
body: Ah, well, that's actually really easy to fix.Throw away your installation and re-install it. HSQL is not used in production, so you haven't got anything in your Confluence you really need, and it's nice to get a clean stable re-installation every now and then for dev/test.


author: Willam Won
body: But now embeded HSQL is used in production,how to migrate to other database such as MySql.


author: Willam Won
body: And I can't login confluence by admin role.


author: Nic Brough -Adaptavist-
body: You've exceeded the attempts to log in with incorrect details. You'll need to use "forgot your password" to retrieve some details, or get one of your other admins to reset the account for you.

comments: author: Willam Won
body: Originally also it can login , but i did nothing, i don't know what happened leading it can't login,the password didn't change.


author: Willam Won
body: By the way, admin is the only account for admins.


Tags: confluence-administration