Could not create customer: Access denied for user 'apsc'@'localhost'

Created:

2016-11-16 13:10:41 UTC

Modified:

2017-08-08 13:23:43 UTC

2

Was this article helpful?


Have more questions?

Submit a request

Could not create customer: Access denied for user 'apsc'@'localhost'

Applicable to:

  • Plesk

Symptoms

It is not possible to create a new customer. The operation fails with the following error:

Internal error: 
ODBC error #HY000: [MySQL][ODBC 3.51 Driver]Access denied for user 'apsc'@'localhost' (using password: YES)

A similar error appears when creating a subscription or installing an APS application:

Internal error: ODBC error #HY000: [MySQL][ODBC 3.51 Driver]Access denied for user 'ODBC'@'localhost' (using password: NO)ODBC error #HY000: [MySQL][ODBC 3.51 Driver]Access denied for user 'ODBC'@'localhost' (using password: NO)ODBC error #HY000: 
File aps_php.php
Line 11933
Type Exception

Cause

Plesk upgrade was completed with errors. Integration with the apsc database was not properly completed.

Resolution

For Plesk 12.5

Use Plesk self-repair tool:

plesk repair db

Note: Do not accept all solutions blindly using this tool.

For Plesk 11.5-12.0 for Linux:

It is possible to repair integration with the apsc database by using the Plesk mass password reset script described in KB article #113391 . You will need to run the script with the following parameter:

Linux:

# MYSQL_PWD=`cat /etc/psa/.psa.shadow`
# /usr/local/psa/bin/sw-engine-pleskrun plesk_password_changer.php $MYSQL_PWD ['current admin password'] --apsc

For all Plesk for Windows versions and for Plesk for Linux 11.0 and earlier :

1) Verify that information about the apsc database exists in Plesk:

**NOTE:** To perform the steps below for Windows, log in to the `psa` database first and then use the queries from the examples.

Linux:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -e "select * from misc where param like 'aps%'"

Windows:

    "%plesk_dir%"\\mysql\\bin\\mysql.exe -uadmin -p<plesk_admin_password> -P8306 psa -e "select * from misc where param like 'aps%'"



    +----------------------+-----------+
| param | val |
+----------------------+-----------+
| aps_database | apsc |
| aps_host | 127.0.0.1 |
| aps_login | admin |
| aps_password | $AES-128-*** |
| aps_port | 8306 |
| aps_secure_passwords | false |
+----------------------+-----------+
6 rows in set (0.00 sec)

NOTE: If aps_password starts with '$AES-128..' , it is encrypted. In this case, proceed to step #2. If the password is in a plain format, skip to step #3.

If you do not have apsc-related parameters, you can add them manually:

INSERT INTO `misc` VALUES ('aps_database','apsc'),('aps_host','127.0.0.1'),('aps_login','apsc'),('aps_password','my_secret_password'),('aps_port','8306'),('aps_secure_passwords','false');


**NOTE:** Specify port **8306** for Windows and **3306** for Linux.

2) It is not possible to decrypt the apsc user password. However, you can take the original password from psa database backups created before upgrading to the new Plesk version.

By default, backups are located in the /var/lib/psa/dumps directory on Linux and in "%plesk_dir%"\\mysql\\Backup on Windows. Open the psa backup and find a line like:

('aps_password','<non_encrypted_passwd>'),('aps_port','8306')
(where `<non_encrypted_passwd>` is the password you need to set).

3) Set the proper privileges for the MySQL database:

Linux:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin mysql -e "grant all privileges on apsc.* to 'apsc'@'localhost' identified by '<non_encrypted_password>'"

Windows:

    "%plesk_dir%"\\mysql\\bin\\mysql.exe -uadmin -p<plesk_admin_password> -P8306 mysql -e "grant all privileges on apsc.* to 'apsc'@'localhost' identified by '<non_encrypted_password>'"
Have more questions? Submit a request
Please sign in to leave a comment.