Database query to delete a user from database

Rahul Aich [Nagra]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 19, 2014

Hi

I am on jira 6.1.4

Can anyone please provide me the databae query to delete a user from the database directly.

A rogue user is not allowing my test jira instance to start up, so i think the only way i can get around the problem is by deleting the user directly from the database.

Rahul

2 answers

1 accepted

1 vote
Answer accepted
Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 20, 2014

I wouldn't try it.

Last time I looked, it was 18 tables, and it's no good just deleting the user, you *MUST* move the data associated with them to other users.

However, the SQL given in the doc you've found will fix the error. Note that it is NOT deleting a user, it is just removing some corrupted user-related data.

0 votes
Boris Georgiev _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 19, 2014

Removing user directly from the DB is the last thing I would do as this might break a lot of things.

Post some more information (log, error messages, etc..) so we can help you get JIRA up and running and avoid the possibility of breaking the database...

Rahul Aich [Nagra]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 19, 2014

My error is the same as in this article (see the section below for MYSQL)

https://confluence.atlassian.com/display/JIRAKB/Upgrade+to+JIRA+6x+fails+due+to+duplicate+entry+into+app_user+table

Now, i cant get the application to load as jira refuses to startup due to this error.

I am in the middle of a upgrade from 5.0 to 6.1

Boris Georgiev _Appfire_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 19, 2014

I suggest you look at the JIRADB schema and figure out the exact query/queries.

https://developer.atlassian.com/download/attachments/4227160/JIRA61_db_schema.pdf?api=v2

And do not forget to backup the DB before you try anything out.

If someone else could provide a complete query it will be great :)

Suggest an answer

Log in or Sign up to answer