Results 1 to 4 of 4

Thread: An error occurred during the backup (Roundcube)

  1. #1
    Join Date
    Sep 2017
    Posts
    2

    Question An error occurred during the backup (Roundcube)

    Since a couple of weeks my DirectAdmin backups stopped working.

    For every user I get the following message:

    User admin has been backed up. <2:00:01>
    RoundCube Backup Error:
    Warning: mysqli::mysqli(): (HY000/2002): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) in /usr/local/directadmin/scripts/backup_roundcube.php on line 114
    Failed to connect to MySQL: (2002) Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)

    It can't connect because I've changed the mysql socket to a different location (/home/mysqldata/mysql/mysql.sock).
    The weeks after changing the socket it all worked, it suddenly stopped working 2 weeks ago.

    Searched everywhere to change the socket for the RoundCube backup script but I can't find a proper solution.

    Who can help me out?

    Kind regards,

    Jordy

  2. #2
    Join Date
    Jul 2015
    Posts
    66
    You can edit:

    /usr/local/directadmin/scripts/php_clean.ini

    And add the following line:

    mysqli.default_socket = /home/mysqldata/mysql/mysql.sock

    After that, do

    chattr +i /usr/local/directadmin/scripts/php_clean.ini

    so that future Directadmin updates won't overwrite your changes. If you need to change the file afterwards yourself, just remove the write protection:

    chattr -i /usr/local/directadmin/scripts/php_clean.ini

    Keep in mind that this will cause an error message when updating Directadmin (because php_clean.ini is not writeable), but this can be ignored.
    Last edited by wtptrs; 09-26-2017 at 04:46 AM.

  3. #3
    Join Date
    Sep 2017
    Posts
    2

    Thumbs up Perfect

    Thanks a lot! All my nightly back-ups are working again

    Quote Originally Posted by wtptrs View Post
    You can edit:

    /usr/local/directadmin/scripts/php_clean.ini


    And add the following line:

    mysqli.default_socket = /home/mysqldata/mysql/mysql.sock

    After that, do

    chattr +i /usr/local/directadmin/scripts/php_clean.ini

    so that future Directadmin updates won't overwrite your changes. If you need to change the file afterwards yourself, just remove the write protection:

    chattr -i /usr/local/directadmin/scripts/php_clean.ini

    Keep in mind that this will cause an error message when updating Directadmin (because php_clean.ini is not writeable), but this can be ignored.

  4. #4
    Join Date
    Apr 2005
    Location
    GMT +7.00
    Posts
    13,482
    Hello,

    If you changed MySQL data dir, wouldn't it be simpler to create a symlink for /var/lib/mysql/ pointing to /home/mysqldata/mysql/ ?
    Regards, Alex G.

    - Get the best commercial DirectAdmin support and hire me on poralix.com
    - Follow and like @Poralix on Facebook

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •