An error occurred during the backup (Roundcube)

KIRKDUIJT

New member
Joined
Sep 25, 2017
Messages
2
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
 
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:
Perfect

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

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.
 
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/ ?
 
Back
Top