List:General Discussion« Previous MessageNext Message »
From:Reindl Harald Date:December 29 2011 5:28pm
Subject:Re: why does basic MySQLdump on db table fail with "Permission denied",
or else it creates a zero KB file
View as plain text  

Am 29.12.2011 18:15, schrieb Govinda:
> ...when I try this:
> mysqldump -uroot -p myDBname myTableName > myTestDumpedTable.sql
> 
> ..then I keep getting this:
> myTestDumpedTable.sql: Permission denied.

your unix-user has no write permissions to myTestDumpedTable.sql
this has nothing to do wirh mysql

what about considering use a target-folder your user owns
and generally use a full-qualified path for the dump-file
instead spit it randomly in the folder where you are

> Same result if I do any variation on that (try to dump the whole db, drop the '-p',
> etc.)

because no parameter can change your folder-pmermissions

> On StackOverflow I asked this question [1], and replies there led me to trying being
> logged in as root user, and then (the same):
> mysqldump -uroot -p myDBname myTableName > myTestDumpedTable.sql
> 
> produces:
> sh: mysqldump: command not found

"mysqldump" is not in the path of your root-user
change the PATH-variable or call mysqldump full-qualified

> ...which is odd because it does produce a zero-KB file named "myTestDumpedTable.sql"
> in that dir. 

it is not odd it is normal that "> myTestDumpedTable.sql" creates the
file since what you are doing is output redirection

> So then I try (in Mac OS X Terminal, while logged in as me (not root)):
> mysqldump -uroot -p myDBname myTableName > ~/myTestDumpedTable.sql
> ...and again it produces:
> sh: mysqldump: command not found..

that is because Mac OSX is missing a package-managment and so you need
a little knowledge about your OS to fix the PATH or you have to use
full-qualified calls or configure/install your software to locations
which are already in the path

"which mysqldump" as normal user wil tell you where it is really
[harry@srv-rhsoft:~]$ which mysqldump
/usr/bin/mysqldump



Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Thread
why does basic MySQLdump on db table fail with "Permission denied", or else it creates a zero KB fileGovinda29 Dec
  • Re: why does basic MySQLdump on db table fail with "Permission denied",or else it creates a zero KB fileAndy Wallace29 Dec
  • Re: why does basic MySQLdump on db table fail with "Permission denied",or else it creates a zero KB fileReindl Harald29 Dec
    • Re: why does basic MySQLdump on db table fail with "Permission denied", or else it creates a zero KB fileGovinda29 Dec
      • Re: why does basic MySQLdump on db table fail with "Permission denied",or else it creates a zero KB fileReindl Harald29 Dec
        • Re: (off topic) why PATHhsv1 Jan
          • Re: (off topic) why PATHReindl Harald1 Jan
            • Re: (off topic) why PATHClaudio Nanni1 Jan
              • Re: (off topic) why PATHReindl Harald1 Jan
              • Re: (off topic) why PATHJohan De Meersman1 Jan
                • Re: (off topic) why PATHClaudio Nanni1 Jan
                  • Re: (off topic) why PATHReindl Harald1 Jan
                    • Re: (off topic) why PATHClaudio Nanni1 Jan
                      • Re: (off topic) why PATHReindl Harald1 Jan
                • Re: (off topic) why PATHReindl Harald1 Jan
Re: why does basic MySQLdump on db table fail with "Permission denied", or else it creates a zero KB fileJan Steinman31 Dec
  • Re: why does basic MySQLdump on db table fail with "Permission denied",or else it creates a zero KB fileReindl Harald31 Dec
  • Re: why does basic MySQLdump on db table fail with "Permission denied", or else it creates a zero KB fileGovinda1 Jan
    • Re: why does basic MySQLdump on db table fail with "Permission denied", or else it creates a zero KB fileJan Steinman2 Jan
      • Re: why does basic MySQLdump on db table fail with "Permission denied", or else it creates a zero KB fileGovinda3 Jan
        • Re: why does basic MySQLdump on db table fail with "Permissiondenied", or else it creates a zero KB filehsv4 Jan
          • Re: why does basic MySQLdump on db table fail with "Permission denied", or else it creates a zero KB fileGovinda4 Jan
Re: (off topic) why PATHJan Steinman4 Jan
  • Re: (off topic) why PATHReindl Harald4 Jan