• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Issue Could not connect to database

gowhar

New Pleskian
Server operating system version
Linux
Plesk version and microupdate number
18.0.43
Hi on 6th April, i updated the password of the database because I did not had the old password to access it, as the website was designed 7-9 years ago by a web designer. Once i updated the password, I was able to access the database and phymyadmin.
However, just after that website stopped functioning giving error "Could not connect to database. Please check configuration and ensure MySQL is running."

In the Log files, I can also see this warning/error message on the same date and time after i updated the password.
" AH01071: Got error 'PHP message: PHP Warning: mysql_connect(): Access denied for user 'explorec_user'@'localhost' (using password: YES) "

I would highly appreciate your help in order to where and how should I update the new password in/for the database, so that my website starts working again.
 
If this question is about a website, such a website normally has a configuration file such as conf.php, config.php or /inc/config.php or something alike. In that file there are normally lines like "database= ..., password=..." etc. You'll need to find the config file, edit the database credentials in it, then access will probably work again.
 
Unfortunately in my case it affects the whole server. Erverything is down. I made a Snapshop and just did it (back
up admin configs and server settings). It is still working. Let's see if it solves the issue.
 
By the way, is there anything where I could get the information what exactly a backup do restore, when ?
LicenceKey is self-describing. Server Settings, just what Plesk configured or is it everything as it was at that backup-timepoint?
Admin-Account-Config what does it mean exactly, just some setting in plesk-backend which get restored or is it also set passwords etc at plesk installation?
Admin-Reseller and customers means all subscriptons there I guess and -admin-domains all subcription regisert in the admin account?

And when Restore a backup "All objects (entire system)" is it only everthing at plesk or also the server?
 
A Plesk full backup covers almost all settings and files of a Plesk installation. This includes emails, databases, configurations, directories, files. There are some business objects that are not stored in a backup. The limits are the same as for the Plesk Migrator extension and documented here: https://support.plesk.com/hc/en-us/articles/12377863617559
A backup does not backup the system including the operating system, but only the Plesk content, e.g. websites, their configurations etc.
 
btw if you're trying to log into the plesk database, you won't have the password for it since it uses a shadow hash login that you can read more at How to connect to a MySQL server on a Plesk for Linux server using a MySQL admin password in plain text - Support Cases from Plesk Knowledge Base (although you should just pass the psa-shadow, you can refer to Database Server for more details (examples) about it) and if you need to reset the hash because you can no longer log into plesk panel you can refer to https://support.plesk.com/hc/en-us/...-for-user-admin-localhost-using-password-YES- for how to fix it
 
If this question is about a website, such a website normally has a configuration file such as conf.php, config.php or /inc/config.php or something alike. In that file there are normally lines like "database= ..., password=..." etc. You'll need to find the config file, edit the database credentials in it, then access will probably work again.
Thank you, Peter. This worked :)
 
btw if you're trying to log into the plesk database, you won't have the password for it since it uses a shadow hash login that you can read more at How to connect to a MySQL server on a Plesk for Linux server using a MySQL admin password in plain text - Support Cases from Plesk Knowledge Base (although you should just pass the psa-shadow, you can refer to Database Server for more details (examples) about it) and if you need to reset the hash because you can no longer log into plesk panel you can refer to https://support.plesk.com/hc/en-us/...-for-user-admin-localhost-using-password-YES- for how to fix it
I'll try this out. The original isse was many nginxfails in th etroubleshooter, ever nginx is running fine as the rest. Plesk Solution told me reread IP adresses, this don't gave solutoion, a second one told me that this are only earlierer faults and I should deleate them. (Just forgot where I bookmarked it, I copied it somewhen:
Connect to the server via SSH.
Create folder for temporary used files:

# mkdir -p /tmp/plesksupport

Create file with other affected domains:

# MYSQL_PWD='cat /etc/psa/.psa.shadow' mysql -uadmin psa -Ne"select name from domains where id in (select objectId from Configurations where status<>'ok')" > /tmp/plesksupport/domainlist.txt

Reconfigure other affected domains:

# cat /tmp/plesksupport/domainlist.txt | while read domain; do /usr/local/psa/admin/bin/httpdmng -–reconfigure-domain $domain; echo "$domain – success"; done
# /usr/local/psa/admin/bin/httpdmng –-reconfigure-server

Then it told me I could not connect db with admin@localhost acces dienied, Password Yes, the I did https://support.plesk.com/hc/en-us/...-for-user-admin-localhost-using-password-YES- scsa20 mention in one repliy, then I got the fun last two days.

So far these db issue is not resolved, but overnight I got the server and all subscriptions to run. So I'll try the log in with the hash later, when I got encouraged again to likly destroy everything again.

Question, is there anything to check out, weather a admin@localhost ist there or gone a plesk db? If gone, can I create a new one?
 
Back
Top