Admin Backup/Transfer mysqldump error

jirawat

Verified User
Joined
Mar 11, 2008
Messages
9
Hi all,
I've run Admin Backup/Transfer and got error message as below.

Error while backing up database malteseman_mmt
Error while backing up database malteseman_mmt: The sql file is 0 bytes in size: /backup/malteseman/backup/malteseman_mmt.sql
mysqldump error output: mysqldump: Got error: 1045: Access denied for user 'root'@'localhost' (using password: NO) when trying to connect

I'll notice DA using root@localhost to backup DB, but /usr/local/directadmin/conf/mysql.conf using user=da_admin.

How to resolve this issue?
 
It's telling you that the sql file is 0 bytes in size. So it can't back it up.

If the database is unused, then 0 bytes in size, and not being able to back it up is fine.

If the database has been used and should be full of data, but isn't, you'd have to have a backup from somewhere else to use, because the current file contains no data.

Jeff
 
Sometimes concurrent stdout and stderr is not synchronized, leading to wrong assumptions; my guess is that the "Access denied" error is the cause for the sql file to be of 0 bytes, and this is easily understandable: for a couple of versions DA has introduced a new dependency: the file /usr/local/directadmin/conf/my.cnf must contain those lines:
Code:
[client]
user=da_admin
password=<same password as in /usr/local/directadmin/conf/mysql.conf>
My guess is that you don't have it.
If you do a copy/paste from the mysql.conf file, make sure you modify "passwd" with "password".

http://www.directadmin.com/features.php?id=969
 
Last edited:
Thank you for your reply.

Actually, a file /usr/local/directadmin/conf/my.cnf already exist.
cat /usr/local/directadmin/conf/my.cnf
[client]
user=da_admin
password=xxxxxx

I'm notice why DA using root to backup database?

So I edit file /root/.my.cnf then try to backup again and no error now.
cat /root/.my.cnf
[client]
user=root
password=xxxxxx

I move /root/.my.cnf to /root/my.cnf.bak and backup again, then I go back to Message System I found Your backups are now ready without error.

I guess DA read /root/.my.cnf first, if /root/.my.cnf is not exist then read /usr/local/directadmin/conf/mysql.conf

P.S. My DA v1.33.7
 
I see this from time to time where admins create:
Code:
/root/.my.cnf
with user/pass values set in there. This overrides everything and is very good at creating a lot of confusion and breaking things. Delete /root/.my.cnf if you have it.

This is related for when we added the feature:
http://www.directadmin.com/features.php?id=969

It uses the --defaults-extra-file option, which means it still accepts other my.cnf data in case you have custom settings you need.

John
 
Back
Top