DirectAdmin Upload Backup fails with wrong user account

llamprec

Verified User
Joined
Apr 6, 2022
Messages
38
Greetings Support People,

I am very new to DirectAdmin.
I have just installed DirectAdmin without any issues. I am trying to import two databases into two different accounts. The first went without hassle.
After the installation was completed, logged in with a user bob, created a database called bob_site, used the username bob_site as the user for the database. I was able to upload and restore the related database.
I tried to do the same with a second user mary, I logged in as mary, created a database called mary_site, and a user called mary_admin, this part went well. I had an issue when trying to upload the backup file. After the upload, the file is processed but then I receive an error

"Unable to restore database mary_site : ERROR 1045 (28000): Access denied for user 'mary'@'localhost' (using password: NO)"

What is confusing is the fact that I am logged in as the user mary, but have said that I want to use the user mary_admin to upload the database, but this is not respected.

I have tried multiple things to try to force the upload but without success. I cannot explain how and why the first database was able to be restored and not the second.

Thanks for any help, input or advice that you might have available.
Lawrence
 
Seems for some reason the system things the user to be used is mary. Maybe because it's mary_admin and maybe admin is not allowed for some reason.
Could you try deleting the empty database and user, and create a new one, but then give the user another name like mary_admin1 or mary_dbuser or whatever, because the username and pass don't matter, you can always change those credentials in the config of the app using the database.
 
Hey Richard,

Thanks for your reply. I have already tried that with many different naming conversions.

Something strange though. As I said I have an user bob and a successfully uploaded db. I edited the sql file and created a new db called bob_test and as the user bob managed to successfully upload the so-called bad file. So it is something strange with DirectAdmin that is not allowing the second user to upload db files.

Also in the meantime, I found a thread that suggested changing from mysql to mariadb .... did that and now my db is down. haha haha not cool. luckily it is a test machine.
 
I found a way to fix the DB which is now working, but the second user can still not upload files as the DB user.

Anyone else have any ideas?
Thanks
Lawrence
 
This post can be closed. The solution was really simple and my lack of knowledge and experience within DirectAdmin.
I had not allocated sufficient diskspace to allow the uploaded file to be stored. The confusing issue was the error given is very misleading. It says nothing related to diskspace. The error says that it is related to permissions and nothing to do with diskspace. So sorry for wasting people time with this issue.

It is now resolved.
Thanks
Lawrence
 
The confusing issue was the error given is very misleading.
That concused me too as normally the uploading of databases is very simple, unless you want to change paths fysically, normally you don't even need to edit the sql file either.

Thanks for reporting back! (y)
 
I found a way to fix the DB which is now working, but the second user can still not upload files as the DB user.

Anyone else have any ideas?
Thanks
Lawrence
All good and well to say that I found a fix, but it would be better to say what the fix was so that it is easier to understand.
Basically the suggestion was as follows.

cd /usr/local/directadmin/custombuild/
mv /var/lib/mysql /var/lib/mysql.moved
/build update
./build mysql

This resolved my issues after trying to do the mysql to mariadb migration failed

Lawrence
 
Yes that's a rebuild of mysql. But in fact the solution was to create more disk space first.
So this wouldn't have helped before, right?
 
Yes that's a rebuild of mysql. But in fact the solution was to create more disk space first.
So this wouldn't have helped before, right?
well .... I am not sure that these are related, The disk space was related to a single site, and apart from being misleading, it would not have crashed the DB.

What I did after some research was try to move from mysql to mariaDB. After following the steps, at the end when I tried to restart the database it would not come up. So the suggested solution was to mv the mysql dir to a backup and run the mysql build command to rebuild the database. The fact that I have made the changes to use mariaDB, did not have any hassles after the rebuild.
Just happy it solved the issue and all is working now.

Thanks again for the help and advice.
Lawrence
 
Ok that seems clear and also logical. I was just trying to put the finger to exact solution for future help to others maybe.

I didn't expect a rebuild of the database to correct a login error. But seems it did so I also learned something again.
Thank you for the additional information!
 
Back
Top