imscp-backup-all access denied for mysql

  • Hello,
    from 2 days i have on all of my servers:


    iMSCP::Database::mysql::dumpdb: mysqldump: Got error: 1045: Access deniedfor user 'root'@'localhost' (using password: YES) when trying to connect


    mysql password is the same. What can be the reason ?


    Problem is in file /var/www/imscp/engine/backup/imscp-backup-imscp


    my $rs = $db->dumpdb($main::imscpConfig{'DATABASE_NAME'}, $sqlFName);
    error("Unable to dump the $main::imscpConfig{'DATABASE_NAME'} database") if $rs;
    return $rs if $rs;


    Somehow $rs returns 2.How can i make it print user and password so i can see what is the problem exactly ?


    I put extra prints in: imscp-backup-imscp


    function "sub _backupDatabase"


    print "Date: $date\n";
    print "SQLFileName: $sqlFName\n";
    print "DB Host: $main::imscpConfig{'DATABASE_HOST'}\n";
    print "DB name: $main::imscpConfig{'DATABASE_NAME'}\n";
    print "DB User: $main::imscpConfig{'DATABASE_USER'}\n";
    print "DB Pass: $main::imscpConfig{'DATABASE_PASSWORD'}\n";


    Date: 2015.03.16-15-51
    SQLFileName: /var/www/imscp/backups/ispcp-2015.03.16-15-51.sql
    DB Host: localhost
    DB name: ispcp
    DB User: root
    DB Pass: *********
    RS = 2


    Information is absolutely correct as in /etc/imscp/imscp.conf but
    still the scripts exits here:
    my $rs = $db->dumpdb($main::imscpConfig{'DATABASE_NAME'}, $sqlFName);
    error("Unable to dump the $main::imscpConfig{'DATABASE_NAME'} database") if $rs;


    [ERROR]


    iMSCP::Database::mysql::dumpdb: mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using password: YES) when trying to connect
    main::_backupDatabase: Unable to dump the ispcp database


    [FATAL]


    Exit code: 2



    Anyone can help ?


    Additional info:
    access denied i have only on machines which are upgraded from ispcp 1.0.7

  • Have you changes something since the last two days?

  • Start-Date: 2015-03-15 12:33:42
    Commandline: apt-get upgrade
    Upgrade: libnss3:i386 (3.14.5-1+deb7u3, 3.14.5-1+deb7u4), libicu48:i386 (4.8.1.1-12+deb7u1, 4.8.1.1-12+deb7u2), libssh2-1-dev:i386 (1.4.2-1.1, 1.4.2-1.1+deb7u1), libgcrypt11-dev:i386 (1.5.0-5+deb7u2, 1.5.0-5+deb7u3), libssh2-1:i386 (1.4.2-1.1, 1.4.2-1.1+deb7u1), libgcrypt11:i386 (1.5.0-5+deb7u2, 1.5.0-5+deb7u3), gpgv:i386 (1.4.12-7+deb7u6, 1.4.12-7+deb7u7), libnss3-1d:i386 (3.14.5-1+deb7u3, 3.14.5-1+deb7u4), gnupg:i386 (1.4.12-7+deb7u6, 1.4.12-7+deb7u7)
    End-Date: 2015-03-15 12:34:17


    I can confirm after that date backups are not working. From WEB control panel is ok, everything works except backups for customers and imscp.

  • .my.cnf should look like this:


    [client]
    user=root_mysql_user
    password=mysql_passowrd
    socket=/var/run/mysqld/mysqld.sock


    socket line may be different or even missing
    file should be in /root folder and readable/writable only by root !

  • @sanitariu


    Wrong !


    The /root/.my.cnf file is generated by i-MSCP and should look like this:


    Code
    1. [mysqldump]
    2. host=localhost
    3. port=3306
    4. user=root
    5. password=the password


    Now, if something goes wrong, you should check the /etc/mysql/my.cnf configuration file.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206