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 List-Archive: http://lists.mysql.com/mysql/226521 Message-Id: <4EFCA34E.20803@thelounge.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig6D82A237A3C4AA0AD476CE17" --------------enig6D82A237A3C4AA0AD476CE17 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Am 29.12.2011 18:15, schrieb Govinda: > ...when I try this: > mysqldump -uroot -p myDBname myTableName > myTestDumpedTable.sql >=20 > ..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, dr= op 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 >=20 > 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 "myTestDum= pedTable.sql" in that dir.=20 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 --------------enig6D82A237A3C4AA0AD476CE17 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAk78o04ACgkQhmBjz394Anle3QCgigRRIeH1sDzwaBfq/cEiWbl5 ig4AoJ2TbbEL/tj8FbqrzFQ7ntlhLO5C =kVHr -----END PGP SIGNATURE----- --------------enig6D82A237A3C4AA0AD476CE17--