The following commands work as expected except for the mysqldump
command:
/var/www$ sudo mount -t ext4 /dev/sda11 /mnt
/var/www$ cd /mnt
/mnt$ sudo mkdir blabla
/mnt$ ls -la
drwxr-xr-x 5 root root 4096 apr 1 19:24 .
drwxr-xr-x 23 root root 4096 mrt 14 13:39 ..
drwxr-xr-x 2 root root 4096 apr 1 19:24 blabla
/mnt$ cd /var/www
/var/www$ sudo mysqldump -u root -p --databases drupal10 --hex-blob > /mnt/drupal10.sql;
**bash: /mnt/drupal10.sql: Permission denied**
It seems that additional sudo
privileges are required to perform the redirect part in the mysqldump command.
Any idea how to solve? Thanks
>
) is not part of thesudo
command, so that is being run as your regular user who doesn't have write access to the file. See the answers to the duplicate questions for workarounds. In your case, you probably wantmysqldump -u root -p --databases drupal10 --hex-blob | sudo tee /mnt/drupal10.sql
. – terdon Apr 01 '23 at 18:10watchdog
ENABLE KEYS /; UNLOCK TABLES; mysqldump: Got error: 1049: Unknown database '|' when selecting the database – jwa Apr 03 '23 at 18:15|
as a database name. We would have to see the exact script and also know exactly how you run it (sh script
?bash script
? making it executable and running./script
? something else?) to understand what the issue is. – terdon Apr 03 '23 at 18:26