NCP Problem with backup/mysqldump


NextCloudPi version v1.50.4
NextCloudPi image NextCloudPi_12-20-22
OS Debian GNU/Linux 11. 5.15.76-v8+ (aarch64)
Nextcloud Version:
PHP version: 8.1

Hello everybody!
I got my nextcloud pi working and it works pretty fine. I used the But I am facing a problem while backupping my ncp with mysql.
I use a sh script for backup and everything works except the mysqldump. I use this command:

mysqldump --single-transaction -h localhost -u ncadmin -p PasswortThatIsShownInTheNCPPanel > /media/NC-Backup/Backups/Nextcloud/NextcloudBackup_DB_date +"%Y%m%d".sql

I have already tried logging in in the shell, but every time in fails, because it says I got no permission. Now to my question: Where do I find the right password to add it to my script or what do I have to do to get rid of the permission problem?

If you need some further information, please just ask for it.

I wish all of you happy holidays!

Hello Kido,

I’m running a script in cron job as root that does the backup (mysql -u root without password).


hey, thanks for your reply.
Could you tell me the whole command you are using pls?

I created these 2 files, the first one is run by cron:

cat /etc/cron.d/mariadb-backup
0 22 * * * root /usr/local/bin/ >/var/log/mariadb-backup.log 2>&1

cat /usr/local/bin/

mysqldump -u root --single-transaction nextcloud > ${1:-/media/myCloudBackup/mariadb-backups}/nextcloud-sqlbkp_$( date +“%Y%m%d_%H%M%S” ).bak