Error while backing up database XXX sql file is 0 bytes in size

serversetupco

Verified User
Joined
Jul 3, 2018
Messages
19
Hello
when I backup the accounts i give this error:
Error while backing up database SQL file is 0 bytes in size

my.cnf contents:

[mysqld]
max_allowed_packet=500M
local-infile=0
innodb_file_per_table
open_files_limit=10000

read_buffer_size=2M
read_rnd_buffer_size=2M
join_buffer_size=2M
sort_buffer_size=2M
query_cache_size=64M
query_cache_limit=512K
query_cache_type=1

max_connections=300
thread_cache_size=15


innodb_buffer_pool_size = 2G
innodb_buffer_pool_instances = 10
innodb_thread_concurrency = 0
innodb_write_io_threads = 64
innodb_read_io_threads = 64
innodb_strict_mode = 'OFF'
sql_mode=""
 
If you can help, answer, otherwise there is no need to answer. I definitely did not get a response from the first post when I updated the old post...
...
Most important things first. This forum is Community based the questions are generally answered by community members. It is frequented by Directadmin support members but it not the main place to get support from Directadmin. If you have a licence and need company based support please log a ticket here. If you don't have support please email [email protected] to purchase if needed. If you bought a server from a company and it came with a license. Contact that company they support you not Directadmin. If you need Consultation services look here.
...
 
If you can help, answer, otherwise there is no need to answer. I definitely did not get a response from the first post when I updated the old post...
If you want to be helped, try to use forums like is done normally. You can always up your post if you get no answer after a couple of days like you did. Sometimes you just have to be patient, no need to up old posts.
DA does have a ticket system for support.

As for your issue, does the account has enough quota to create the backup?
 
[SOLVED] Having the same issue on a new machine on debian 11.7.

Restoring sites does not work neither creating backups.

Code:
cd /usr/local/directadmin/custombuild
./build mysql_backup

gives:

ERROR 2002 (HY000): Can't connect to local server through socket '/run/mysqld/mysqld.sock' (2)


I think re-building with ./build all did screw things up

In /etc/my.cnf I have now
socket=/usr/local/mysql/data/mysql.sock


Code:
ls -l /usr/local/mysql/data/mysql.sock
gives:
srwxrwxrwx 1 mysql mysql 0 May 22 09:14 /usr/local/mysql/data/mysql.sock

Code:
 ls -l /var/lib/mysql/mysql.sock
gives:
srwxrwxrwx 1 mysql mysql 0 May 22 09:14 /var/lib/mysql/mysql.sock


Should the socket location be set to this latter location in /etc/my.cnf file or what is the right solution?
 
Last edited:
In my /etc/my.cnf I've got:
socket=/var/lib/mysql/mysql.sock

You could try that and then restart mysql/mariadb.

Be SURE that in the /etc/my.cnf.d/ directory you don't have the same setting activated with a different directory!
 
Hi,
Seems not to be the solution. Still I get this:

ERROR 2002 (HY000): Can't connect to local server through socket '/run/mysqld/mysqld.sock' (2)

Should this feature be used?
 
Last edited:
Should this feature be used?
No that is an ancient option, as far as I know that is not used anymore there.

I'm on Centos/Alma but isn't Debian using the my.cnf file inside the /etc/mysql directory instead of /etc directory?

If not... what happens if you remove the socket statement from the my.cnf file and restart mysql/mariadb? Same error?

Maybe @smtalk or @zEitEr can be of help here. I don't use Debian and in Debian some things are a bit different.
 
Check this post, if you have installed mailutils, try and uninstall it.
 
Yes, i have mailutils installed and it caused the problem!

Solved the situation by reverting the changes to /etc/my.cnf and following Nickske00 advice in thread Richard G suggested.
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock' (2)

BUT, after these are set up there is an /etc/mysql/ folder present.

There also is a file /etc/mysql/mariadb.cnf with a line socket = /run/mysqld/mysqld.sock change it to socket = /usr/local/mysql/data/mysql.sock and everything works again. :)

This solved the problem!

Thanks Richard G and Nickske00! (y)
 
Last edited:
Nice to hear it's fixed.
Maybe for this time, you can edit your first post and change the prefix to solved. Thank you!
 
Back
Top