Knowledge Base

The VMware Knowledge Base provides support solutions, error messages and troubleshooting guides
 
Search the VMware Knowledge Base (KB)   View by Article ID
 

Connection to Zimbra database fails with error: ERROR 1044: Access denied for user (2007313)

Symptoms

  • You cannot connect to the Zimbra mysql or logmysql database.
  • Database kogin fails.
  • You see one of these errors:

    • #logmysql
      ERROR 1044: Access denied for user 'zimbra'@'localhost' to database 'zimbra_logger'


    • #mysql
      ERROR 1044: Access denied for user 'zimbra'@'localhost' to database 'zimbra'

Cause

This error occurs when the password stored in the database does not match the password being used to connect.

Resolution

To resolve this issue, you must reset the database password.

If you are using ZCS 7.x, run this command:

/opt/zimbra/libexec/zmresetmysqlpassword

If you are using ZCS 6.x, or if that command does not successfully reset your password, reset your password manually:

  1. Ensure that you are operating as the zimbra user, by running this command:

    su - zimbra

  2. Stop the mysql service, by running this command:

    mysql.server stop

  3. Switch to the root user, by running this command:

    su - root

  4. Modify /opt/zimbra/bin/mysql.server so that mysql skips the grant tables when it starts:

    1. Run this command:

      vi /opt/zimbra/bin/mysql.server

    2. Modify these lines from

      --defaults-file=${mysql_mycnf} \
      --external-locking \
      --ledir=${mysql_directory}/libexec < /dev/null > /dev/null 2>&1 &



      to

      --defaults-file=${mysql_mycnf} \
      --external-locking \
      --ledir=${mysql_directory}/libexec < /dev/null > /dev/null 2>&1 --skip-grant-tables &

    3. Save and exit the file.

  5. Switch to the zimbra user, by running this command:

    su - zimbra

  6. Start the mysql service, by running this command:

    mysql.server start

  7. Connect to the database, by running this command:

    mysql

  8. Change the password, by running this command:

    mysql> UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='user'

    where user is either root or zimbra, as needed.

    Note: Make sure that the password you specify is the same as the password used in localconfig. To check the localconfig passwords, run these commands:

    zmlocalconfig -s | grep mysql_root_password
    zmlocalconfig -s | grep zimbra_mysql_password

  9. Flush the privileges and exit, by running these commands:

    mysql> FLUSH PRIVILEGES;
    mysql> exit

  10. Switch to the root user, by running this command:

    su - root

  11. Reverse the changes made to /opt/zimbra/bin/mysql.server:

    1. Open /opt/zimbra/bin/mysql.server for editing.
    2. Locate and remove this text:

      --skip-grant-tables

    3. Save and exit the file.

  12. Switch to the zimbra user, by running this command:

    su - zimbra

  13. Stop and start the mysql service, by running these commands:

    mysql.server stop
    mysql.server start

You can now connect to the mysql database.

Request a Product Feature

To request a new product feature or to provide feedback on a VMware product, please visit the Request a Product Feature page.

Feedback

  • 1 Ratings

Did this article help you?
This article resolved my issue.
This article did not resolve my issue.
This article helped but additional information was required to resolve my issue.
What can we do to improve this information? (4000 or fewer characters)
  • 1 Ratings
Actions
KB: