List:General Discussion« Previous MessageNext Message »
From:Govinda Date:January 1 2012 4:36am
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  
>>> 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.
> 
> How did you get your copy of MySQL?

I don't remember for sure.. but think I just went to the MySQL site and downloaded
whatever looked like the right version for my environment.  I used to use the one
included with Mac OS 10.5, but when I upgraded to 10.6, then it no longer worked.. so I
had to re-install MySQL.

> If you're using MacOS X Server, it should be in /usr/bin, which should be in your
> default $PATH, or else you couldn't do ANYTHING, including "ls."
> 
> And for the record, there are at least two excellent package managers available for
> Mac OS, and either MacPorts or Fink should append the proper path to their binaries to the
> $PATH variable so they can be found. (Although you need to log out and log back in to have
> your shell's .rc file executed.)
> 
> Or else you built from source, in which case, you should know how to fix your $PATH.

You may have guessed I am pretty much in over my head with running servers..  so I am just
glad I have so far managed to do everything I need to develop, if not look smart on lists
like this  ;-)

I have notes somewhere in my stuff about how to get $PATH to include where mysql actually
lives, but once I realized what the issue was (in my OP this thread) then I was fine with
just using a full path for now.  The convenience of a 'fixed' $PATH will be nice, sooner
or later (when I get to it), but for now it is just as well that I let it beat into my
head how the CL is actually working (working out the full paths)


> What does "locate mysqldump" tell you?

Govind% locate mysqldump

WARNING: The locate database (/var/db/locate.database) does not exist.
To create the database, run the following command:

  sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist

Please be aware that the database can take some time to generate; once
the database has been created, this message will no longer appear.

Govind% sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist
Password:
Govind% locate mysqldump

WARNING: The locate database (/var/db/locate.database) does not exist.
To create the database, run the following command:

  sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.locate.plist

Please be aware that the database can take some time to generate; once
the database has been created, this message will no longer appear.

Huh?  
Password was right.. but   'sudo launchctl load -w
/System/Library/LaunchDaemons/com.apple.locate.plist'   seemed to have no effect.
(Again, way over my head for now).

> How about "echo $PATH"?

Govind% echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin


Thanks for poking :-)
-Govinda
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