Re: why does basic MySQLdump on db table fail with "Permission denied", or else it creates a zero KB file
>> ..which I just (earlier this morning) changed to this: >> export >> PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/mysql/bin/mysqldump:$PATH" > You are missing a point, that the proper thing for PATH is directory (or > effective directory), not runfile in directory. This, therefore, is more > right: > > PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/mysql/bin:$PATH > > After this, surely, you can run "mysqldump" or "mysql" or "mysqlbinlog" or > OK, yes, that makes sense. Thanks. Note though, then that '/usr/local/mysql/bin' path is redundant; it was already there (the preceding path). I also discovered from researching the '/etc/paths.d' dir... where one can store files named after commands one wants to run, whose contents is the paths to those commands. I am now able to run "mysqldump" or "mysql" directly. Thanks to everyone who replied! For the archives, should any newbie actually find this thread on topic for where he/she is stuck, please note this (another great resource for driving mysql, and everything else CL related) - http://superuser.com/ -Govinda -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql
Re: why does basic MySQLdump on db table fail with "Permission denied", or else it creates a zero KB file
;>>> 2012/01/03 11:52 -0500, Govinda ...which strikes me as odd (again, showing how new I am to driving from the CL), because I do NOT see any entry like this: /usr/local/mysql/bin/mysqldump Is "mysql" a symbolic link? ..which I just (earlier this morning) changed to this: export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/mysql/bin/mysqldump:$PATH" You are missing a point, that the proper thing for PATH is directory (or effective directory), not runfile in directory. This, therefore, is more right: PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/mysql/bin:$PATH After this, surely, you can run "mysqldump" or "mysql" or "mysqlbinlog" or -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql
Re: why does basic MySQLdump on db table fail with "Permission denied", or else it creates a zero KB file
Jan, thanks so much for taking the time with me. I hesitate to spend much of everyone's inbox space on this as it is getting off topic, and I am newbie enough with all things CL that folks will tire of me before I am near ready to complete the thread. Like it took me a bit of time to think/research/experiment ... to even discover to the point of responding, that: - (see below, intermingling text) >>> 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." >> >> 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) > > You should fix the $PATH, as you'll need it for utilities (such as mysqldump) > and such. well , yes, it will be nice to no how to manipulate the $PATH ... and meanwhile using full paths when invoking a command does work.. and forces me to at least remember that is how any command works, right? I mean the shell is always (AFAIK) resolving full paths. > > You need to edit your shell startup file. For bash, it's ".bash_profile" in > your home directory. Other shells will have their own startup script. I am using tcsh. I found that my $PATH (apparently) lives here: ~/.profile > My .bash_profile includes: > > export > PATH="$HOME/bin:/Developer/Tools:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/local/bin:/opt/local/sbin" mine was this: export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:$PATH" ..which I just (earlier this morning) changed to this: export PATH="/usr/local/bin:/usr/local/sbin:/usr/local/mysql/bin:/usr/local/mysql/bin/mysqldump:$PATH" > > Do "echo $SHELL" to see which shell you're using. /bin/tcsh > > Do "printenv" to see all your global shell variables, including $SHELL and > $PATH. Govind% printenv PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin [snip] SHELL=/bin/tcsh HOME=/Users/Govind USER=Govind LOGNAME=Govind [snip] PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin I don't understand why this ^^^ is different than what is shown in the '~/.profile' file > >>> 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 > > [message repeated after running the suggested command] > > What that does is tells the system launcher to index your disks in the > background, so it's no surprise that it would not immediately create a > working database. > > It should have finished by now, and you should now be able to run the locate > command. right, yes. Now it works: Govind% locate mysqldump [snip] /usr/local/mysql-5.5.15-osx10.6-x86_64/bin/mysqldump /usr/local/mysql-5.5.15-osx10.6-x86_64/bin/mysqldumpslow /usr/local/mysql-5.5.15-osx10.6-x86_64/man/man1/mysqldump.1 /usr/local/mysql-5.5.15-osx10.6-x86_64/man/man1/mysqldumpslow.1 /usr/local/mysql-5.5.15-osx10.6-x86_64/mysql-test/include/mysqldump.inc /usr/local/mysql-5.5.15-osx10.6-x86_64/mysql-test/r/mysqldump-compat.result /usr/local/mysql-5.5.15-osx10.6-x86_64/mysql-test/r/mysqldump-max.result /usr/local/mysql-5.5.15-osx10.6-x86_64/mysql-test/r/mysqldump-no-binlog.result /usr/local/mysql-5.5.15-osx10.6-x86_64/mysql-test/r/mysqldump.result /usr/local/mysql-5.5.15-osx10.6-x86_64/mysql-test/r/mysqldump_restore.result /usr/local/mysql-5.5.15-osx10.6-x86_64/mysql-test/r/rpl_mysqldump_slave.result /usr/local/mysql-5.5.15-osx10.6-x86_64/mysql-test/t/mysqldump-compat.opt /usr/local/mysql-5.5.15-osx10.6-x86_64/mysql-test/t/mysqldump-compat.test /usr/local/mysql-5.5.15-osx10.6-x86_64/mysql-test/t/mysqldump-max-master.opt /usr/local/mysql-5.5.15-osx10.6-x86_64/mysql-test/t/mysqldump-max.test /usr/local/mysql-5.5.15-osx10.6-x86_64/mysql-test/t/mysqldump-no-binlog-master.opt /usr/local/mysql-5.5.15-osx10.6-x86_64/mysql-test/t/mysqldump-no-binlog.test /usr/local/mysql-5.5.15-osx10.6-x86_64/mysql-test/t/mysqldump.test /usr/local/mysql-5.5.15-osx10.6-x86_64/mysql-test/t/mysqldump_restore.test /usr/local/mysql-5.5.15-osx10.6-x86_64/mysql-test/t/rpl_mysqldump_slave.test ...which strikes me as odd (again, showing how new I am to driving from the CL), because I do NOT see any entry like this: /usr/local/mysql/bin/mysqldump ...which I know is here (and is what I use (AFAICT), when I successfully use the full path to call mysqldump, like so: Govind% /usr/local/mysql/bin/mysqldump -uroot -p myDBname myTableN
Re: why does basic MySQLdump on db table fail with "Permission denied", or else it creates a zero KB file
On 31 Dec 11, at 20:36, Govinda wrote: >> 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." > > 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) You should fix the $PATH, as you'll need it for utilities (such as mysqldump) and such. You need to edit your shell startup file. For bash, it's ".bash_profile" in your home directory. Other shells will have their own startup script. My .bash_profile includes: export PATH="$HOME/bin:/Developer/Tools:/usr/local/bin:/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/local/bin:/opt/local/sbin" Do "echo $SHELL" to see which shell you're using. Do "printenv" to see all your global shell variables, including $SHELL and $PATH. >> 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 [message repeated after running the suggested command] What that does is tells the system launcher to index your disks in the background, so it's no surprise that it would not immediately create a working database. It should have finished by now, and you should now be able to run the locate command. >> How about "echo $PATH"? > > Govind% echo $PATH > /usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/usr/X11/bin I don't have the official binary distribution in front of me, but once you get "locate" working, you can add the path of your MySQL binaries to the $PATH variable by appending it (preceded by a colon) to the $PATH declaration in your shell's startup script. Do you often think about difficulties, failure and disasters? Do you keep thinking about the negative news you have seen on the TV or read in the newspapers? Do you see yourself stuck and unable to improve your life or your health? Do you frequently think that you do not deserve happiness or money, or that it is too difficult to get them? If you do, then you will close your mind, see no opportunities, and behave and react in such ways as to repel people and opportunities. You let the power of negative thinking rule your life. -- Ramon Sasson Jan Steinman, EcoReality Co-op -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql
Re: why does basic MySQLdump on db table fail with "Permission denied", or else it creates a zero KB file
>>> 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 -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql
Re: why does basic MySQLdump on db table fail with "Permission denied", or else it creates a zero KB file
Am 31.12.2011 23:53, schrieb Jan Steinman: > And for the record, there are at least two excellent package managers > available for Mac OS, and either MacPorts or Fink if you call this package-managment from the view of a operating system you have never seen a real one - this are ADDITIONAL program/managers TRYING to do things OSX does not support signature.asc Description: OpenPGP digital signature
Re: why does basic MySQLdump on db table fail with "Permission denied", or else it creates a zero KB file
>> 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? 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. What does "locate mysqldump" tell you? How about "echo $PATH"? A gentleman of our days is one who has money enough to do what every fool would do if he could afford it: that is, consume without producing. -- George Bernard Shaw Jan Steinman, EcoReality Co-op -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql
Re: why does basic MySQLdump on db table fail with "Permission denied", or else it creates a zero KB file
Am 29.12.2011 19:21, schrieb Govinda: > Just a side note, that: > > Govind% which mysqldump > mysqldump: Command not found. > Govind% which /usr/local/mysql/bin/mysqldump > /usr/local/mysql/bin/mysqldump > > kind of defeats the purpose of having to know the path in advance in order > to use the command to detect the path ;-) "/usr/local/mysql/bin/" is nowhere in the path "which" can only help you if your standard-user has the directory in his PATH and another user not in my opinion this is a configure/compile/install-problem /usr/local/ is intended to have the stahtdard unix-hirarchy like /usr/loca/bin, /usr/local/share, /usr/local/lib and normally /usr/local/bin IS in the PATH so the problem here is that "mysql" has the unix-hirarchy inside instead directly install into /usr/lcoal/ on the other hand doing this without a package-managment it would be better over the long to keep it chaind all in one directory as it is because you can uninstall it with simply remove the folder for the hadnful things on my linux-machines where such non-default locations are existing i usually set symlinks unter /usr/local/bin/ to the binarys, so they are seperated and from the user point of view in the PATh and all wroks fine additionally a "ls -l /usr/local/bin/" shows where all the stuff is physically installed instead haveing all details in mind or notice them somewhere you forget also :-) signature.asc Description: OpenPGP digital signature
Re: why does basic MySQLdump on db table fail with "Permission denied", or else it creates a zero KB file
> [snip] > 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 Thank you Richard, Andy, and Reindl ! Of course you all nailed it. Reindl, I especially appreciate you addressing each point, as it pointed me in the right direction to fill in the understanding-holes on all those topics! Some things I (partially) knew, but did not remember today because I don't have to deal in these areas much. For right now, I just used full paths both for the command and for the output. Just a side note, that: Govind% which mysqldump mysqldump: Command not found. Govind% which /usr/local/mysql/bin/mysqldump /usr/local/mysql/bin/mysqldump kind of defeats the purpose of having to know the path in advance in order to use the command to detect the path ;-) -Govinda -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql
Re: why does basic MySQLdump on db table fail with "Permission denied", or else it creates a zero KB file
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 signature.asc Description: OpenPGP digital signature
Re: why does basic MySQLdump on db table fail with "Permission denied", or else it creates a zero KB file
I would suggest trying: mysqldump -uroot -p myDBname myTableName > /tmp/myTestDumpedTable.sql Maybe you don't have permission (or space) to write into /usr/local/mysql/bin. That would be an unusual place for such files. On 12/29/11 9:15 AM, Govinda wrote: Hi Everyone This should be quick and simple, but after researching on Google quite a bit I am still stumped. I am mostly newbie with: server admin, CLI, MySQL. I am developing my PHP site locally, and now need to move some new MySQL tables from my local dev setup to the remote testing site. First step for me is just to dump the tables, one at a time. I successfully login to my local MySQL like so: Govind% /usr/local/mysql/bin/mysql -uroot but while in this dir (and NOT logged into MySQL): /usr/local/mysql/bin ...when I try this: mysqldump -uroot -p myDBname myTableName> myTestDumpedTable.sql ..then I keep getting this: myTestDumpedTable.sql: Permission denied. Same result if I do any variation on that (try to dump the whole db, drop the '-p', etc.) 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 ...which is odd because it does produce a zero-KB file named "myTestDumpedTable.sql" in that dir. 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... and again a zero-KB file named "myTestDumpedTable.sql", in ~/ I am embarrassed as I am sure this is going to be incredibly simple, or just reveal a gaping (basic) hole in my knowledge. .. but I would appreciate any help ;-) [1] http://stackoverflow.com/questions/8663454/why-does-basic-mysqldump-on-db-table-fail-with-permission-denied Thanks -Govinda -- Andy Wallace iHOUSEweb, Inc. awall...@ihouseweb.com (866) 645-7700 ext 219 -- There are two ways to build software: Make it so simple that there are obviously no bugs, or make it so complex that there are no obvious bugs. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql
why does basic MySQLdump on db table fail with "Permission denied", or else it creates a zero KB file
Hi Everyone This should be quick and simple, but after researching on Google quite a bit I am still stumped. I am mostly newbie with: server admin, CLI, MySQL. I am developing my PHP site locally, and now need to move some new MySQL tables from my local dev setup to the remote testing site. First step for me is just to dump the tables, one at a time. I successfully login to my local MySQL like so: Govind% /usr/local/mysql/bin/mysql -uroot but while in this dir (and NOT logged into MySQL): /usr/local/mysql/bin ...when I try this: mysqldump -uroot -p myDBname myTableName > myTestDumpedTable.sql ..then I keep getting this: myTestDumpedTable.sql: Permission denied. Same result if I do any variation on that (try to dump the whole db, drop the '-p', etc.) 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 ...which is odd because it does produce a zero-KB file named "myTestDumpedTable.sql" in that dir. 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... and again a zero-KB file named "myTestDumpedTable.sql", in ~/ I am embarrassed as I am sure this is going to be incredibly simple, or just reveal a gaping (basic) hole in my knowledge. .. but I would appreciate any help ;-) [1] http://stackoverflow.com/questions/8663454/why-does-basic-mysqldump-on-db-table-fail-with-permission-denied Thanks -Govinda -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/mysql