• 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.

mysql odbc error: apsc user password mismatch - access denied

jens1

New Pleskian
when i try to install a new app in plesk webfrontend of any(doesnt matter) user i got this error.
i remember i had it before and misleadingly i remember after hours of searching not barely finding some infos about it i thought i solved this. somehow new updates broke this

before going back deep into it, can you kindly explain how to set correct apsc mysql password.
somehow it is stored in /etc/ somewhere and than ...
i know it was a mismatch of different saved passwords ..

Code:
Fehler: Beim Herunterladen der Anwendung ist folgender Fehler aufgetreten: ODBC error #HY000: [unixODBC][MySQL][ODBC 5.2(w) Driver]Access denied for user 'apsc'@'localhost' (using password: YES)

thanks a lot
 
Hi jens1,

you could try to use the "mass_password_changer" ( http://kb.odin.com/Attachments/19094/Attachments/plesk_password_changer.zip ) with the option to only change the password for the user "apsc":

Example:

mkdir -p /root/addons/plesk/mass_password_changer
cd /root/addons/plesk/mass_password_changer
wget http://kb.odin.com/Attachments/19094/Attachments/plesk_password_changer.zip
unzip plesk_password_changer.zip
/usr/local/psa/bin/sw-engine-pleskrun plesk_password_changer.php `cat /etc/psa/.psa.shadow` ['current admin password'] --apsc

( Please replace ['current admin password'] with your current admin password to avoid issues/failures/problems!!! )
 
thx - that helped a bit, but i prefer a bit more knowing what i am doing there ..
so i got the specific line out ouf the script and modified it for my purpose

got me this :
/opt/psa/bin/sw-engine-pleskrun /opt/psa/admin/plib/scripts/register_apsc_database.php --register -host 'localhost' -port 3306 -database 'apsc' -login 'apsc' -password 'cat /etc/psa/.psa.shadow'

which simply should preserve existing password, but i guess someshow this is the problem : a mismatch of mysql stored pw and the pass stored in /etc/psa/.psa.shadow

using this line i got the exact error in the webfrontend
/opt/psa/bin/sw-engine-pleskrun /opt/psa/admin/plib/scripts/check_apsc_connection.php
Connection to APSC DB is not possible: ODBC error #HY000: [unixODBC][MySQL][ODBC 5.2(w) Driver]Access denied for user 'apsc'@'localhost' (using password: YES)


even if i run your script i got this
Code:
user@lalalala:~# php ./plesk_password_changer.php --apsc
[2015-10-21 05:19:49][FATAL_ERROR] [MYSQL ERROR] Given <password> is incorrect. Access denied for user 'admin'@'localhost' (using password: YES)
user@lalalala:~# php ./plesk_password_changer.php --admin
[2015-10-21 05:19:49][FATAL_ERROR] [MYSQL ERROR] Given <password> is incorrect. Access denied for user 'admin'@'localhost' (using password: YES)
####
#### even as you (and --help suggested) doesnt work ,
#### or i dont remember my pass, but that cant be true
php ./plesk_password_changer.php `cat /etc/psa/.psa.shadow` 'someniceone' --apsc
[2015-10-21 05:33:22][INFO] ==> Installed Plesk version/build: 12.5.30 Debian 7.0 1205150826.19
[2015-10-21 05:33:22][FATAL_ERROR] Unable to find Plesk 8.x or Plesk 9.x or Plesk 10.x. Tool must be launched prior to upgrade to Parallels Panel 11.5.0 for the purpose of getting a report on potential problems with the upgrade.

even while Plesk creates /etc/psa/.psa.shadow file which contains encrypted password for user 'admin' you can use to connect to mysql. No plain text...
so using the script make no real sense if understand the script right.
i can easily login in mysql via
mysql -uadmin -p'cat /etc/psa/.psa.shadow'
but not for apsc ..

the question remains , what where and how is apsc passwords stored and altered

the snippet out of the skript
PHP:
function changeForApsc()
        {
                if (Util::isLinux() && PleskVersion::is11_5_or_above()) {
                        Log::step("Change password for apsc database...", true);

                        $cmd = "{$this->plesk_dir}/bin/sw-engine-pleskrun {$this->plesk_dir}/admin/plib/scripts/check_apsc_connection.php";
                        $output = Util::exec($cmd, $code);

                        if ($output === 'connection ok') {
                                Log::info('apsc connection is OK. Skip password changing.');
                        } else {
                                $newPassword = $this->getNewPassword();

                                $db = PleskDb::getInstance();
                                $sql = "SET PASSWORD FOR 'apsc'@'localhost' = PASSWORD('${newPassword}')";
                                $result = $db->query($sql);
                                $db->close();

                                $cmd = "{$this->plesk_dir}/bin/sw-engine-pleskrun {$this->plesk_dir}/admin/plib/scripts/register_apsc_database.php --register -host 'localhost' -port 3306 -database 'apsc' -login 'apsc' -password '${newPassword}'";
                                $output = Util::exec($cmd, $code);
                                if ($output === 'APSC database has been registered successfully') {
                                        Log::info('apsc database login: apsc New password: ' . $newPassword);
                                        return;
                                }
                                Log::warning("Update password for apsc database is failed! Command failed: ${cmd}: ${output}");
                        }
                }
 
Last edited:
the script dont work while it only test up to version 12.0.0 ... and the latest Version is 12.5.30 or so
so thats somehow a bug, i circumvent by tricking the script (bad taste way) in this case, than at least the script works fine
 
Hi @jens1!

If you use Plesk 12.5 you can use Plesk self-repair feature to fix password of apsc user. It's made in scope of database repair aspect:
# plesk repair db
 
Back
Top