Jump to content

Restoring a Deleted Database User?


BeneficialCucumber

Recommended Posts

Hi guys.

I think I accidentally removed a critical database user account.

It was during a cleanup process where old/unused databases and users were removed.

My screw up was not doing a backup before starting on this, even though I'm quite sure all the dbs/users were not being used. I was probably wrong on this.

 

This is the following error on the phpvms site:

 

SQLSTATE[28000] [1045] Access denied for user 'testVA_user'@'localhost' (using password: YES) (SQL: select * from `users` where `state` != 5 order by `created_at` desc limit 4)

 

phpVMS version: 7.0.0-dev

cPanel Version: 100.0 (build 7)

Apache Version: 2.4.52

PHP Version: 7.4.27

MySQL Version: 10.3.32-MariaDB

 

Can anyone advise how it can be resolved please?

eg. Creating another account with the same username, but I would still not know what the password of the old account was.

 

Would prefer not to do a full restore as the last one I have is from end-Jan.

Edited by BeneficialCucumber
Link to comment
Share on other sites

The flight in progress shows the following error message in vmsACARS:

 

There was an error updating this PIREP: SQLSTATE[28000] [1045] Access denied for user 'testVA_user'@'localhost' (using password: YES) (SQL: select * from `users` where `api_key` = XXXXXXXXXXX limit 1

 

Judging by these symptoms, is this an issue of deleted user account or deleted database?

If it is the former, can we "relink" it with another account with a new password?

If it's the latter, I will have no choice but to restore from the last automated server backup, but I just want to make very sure this is the case before doing so.

Edited by BeneficialCucumber
Link to comment
Share on other sites

4 hours ago, BeneficialCucumber said:

I have restored everything from the last-known backup.

However it is still showing the error message in the first post.

Anyone know what might be the issue?

 

If you delete a user from your database engine, then you need to define it back there. Restoring a database backup will NOT restore the users, it will only restore the structure and data.

 

Database users are not stored in the database itself, they are stored by the database server.

 

Anyway;

  • Either create the same user back from your control panel, grant access to that user for your phpvms database.
  • Or create a new user from your control panel, grant access to that user for your phpvms database, enter that users info to your env.php, clean the application cache manually (folders are explained here , check #3 )

Good luck

  • Thanks 1
Link to comment
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.

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.

Loading...
×
×
  • Create New...