mysqldump not backingup to specified file - wamp

I have the following problem, I tried to back up a database using mysqldump command, and after I enter the corrent command on the terminal:
This is the command:
c:/wamp/bin/mysql/mysql5.5.24/bin>mysqldump -uroot -ptest store > store_bak.sql
/* here it jumps to the next line after pressing ENTER */
c:/wamp/bin/mysql/mysql5.5.24/bin>
I think I'm entering the correct commands on the right place, but the only thing that happens is that it jumps to the next line and no backup is made.
I also cannot find any file named as the backupname I specified (store.sql on this example)
does anybody knows what could be causing this?
ps: i'm using wamp, on windows 7, sql 5.5.24

you need spaces here -uroot -ptest
mysqldump -u root -p test -h localhost store > store_bak.sql

Related

can a "hook" execute a shell command in mutt?

Is there any way to have a "hook" execute a shell command? Either through a:
-
- tick marks (``)
- through "a macro"
I checked the neomutt documentation and it says that the hook command can execute something with backticks:
shutdown-hook 'echo `mbsync -a`'
But whenever I do that, I get:
echo: unknown command
I tried doing a:
shutdown-hook 'echo `ls`'
and I still get the same error. Am I missing something?
Did you place these commands in your .muttrc file?
This does work for me, inserting in .muttrc file
startup-hook 'echo `echo did it > /tmp/mutt-did-it`'
then running mutt, the file /tmp/mutt-did-it then contains did it. It does also work with folder and send hooks.

How to use putty to run a .sas program via a .bat file

I'm using two files:
1- .bat file which contains in one line:
"C:\Path_to\putty.exe" -ssh servername -l myuserid -pw my password -m "C:\Path_to_Commands_File\Commands.txt" -t
2- Commands.txt which contains either one of these commands:
Command#1:
/Path_to_sasprogram/sasprogram.sas
OR
Commands#2 in the following order:
cd /Path_to_sasprogram/
sas sasprogram.sas
However, the sasprogram.sas does not get executed. So, I used putty to manually execute the commands above. With the commands#2, I get this error: "sas: command not found".
Any suggestions/help would be greatly appreciated! BTW, I tried some solutions already posted, but they didn't work for me. Thanks
It sounds like sas is not on the path of your session.
try
/path_to_sas_executable/sas sasprogram.sas

'sc' is not recognized as an internal or external command

I am trying to create a svnserver using cmd after i changed svnserve.conf by uncommenting the following lines in the file,
anon-access = read
auth-access = write
command execute in cmd is,
sc create svnserver binpath= "C:\Program Files\TortoiseSVN\bin\svnserve.exe --service -r c:\Goods\Repo" DisplayName= "Subversion" depend= tcpip start= auto
but i am getting error
'sc' is not recognized as an internal or external command
I am not sure what i am doing wrong. I have installed tortoise SVN Client and Visual SVN Server.
Can someone please let me know what i am missing here.
you will need to add the path to sc.exe ("c:\windows\system32\") in your Path environment variable. Do this by hitting windows key + Pause|Break then selecting advanced system settings - environment variables is at the bottom. Just add an extra entry after the last - separated by semi-colons. If this isn't possible, simply give the command the full path of sc.exe e.g.
"c:\windows\system32\sc.exe" create svnserver....

nohup ./startup & Permission Denied

I successfully compiled a MUD source code, and it says in the instructions to start up the server using
nohup ./startup &
although when I do this it gives me this error:
$ nohup: ignoring input and appending output to `nohup.out'
nohup: failed to run command `./startup': Permission denied
I have looked all over the internet to find the answer. A few of them said to put my cygwin directory in the root folder (I am using windows 7) and its directory is C:\cygwin
so thats not a problem.. Can anyone help me with this please??
Try chmod +x startup, maybe your startup file is not executable.
From "man nohup":
If the standard output is a terminal, all output written by the named
utility to its standard output shall be appended to the end of the
file nohup.out in the current directory. If nohup.out cannot be
created or opened for appending, the output shall be appended to the
end of the file nohup.out in the directory specified by the HOME
environment variable. If neither file can be created or opened for
appending, utility shall not be invoked. If a file is created, the
file's permission bits shall be set to S_IRUSR | S_IWUSR.
My guess is that since "sh -c" doesn't start a login shell, it is inheriting the environment of the invoking shell, including the HOME environment variable, and is trying to open it there. So I would check the permissions of both your current directory and $HOME. You can try to touch test.txt in current directory or $HOME to see if you can perform that command.
As staticx writes, check the permissions of the directory (and the user) - and the executable.
Instead of using nohup:
check if nohup is needed at all, try ./startup </dev/null >mud.out 2>mud.err &, then close the terminal window and check if it is running
or just run ./startup in a screen session and detach it (<ctrl>+<a>,<d>)

Try to execute command line codes from c++ linux

I tried the following code, to communicate with the command line from c++ code.
#include<iostream>
#include<cv.h>
int main()
{
system("gnome-terminal");
system("cd");
}
The gnome-terminal command is executing fine. After I close the terminal, when am expecting the cd to execute, however, is not happening. Could you please help me and point out the reason? Thanks. I was expecting the function to make the cmd go down to the home directory
, but it did not. am working in linux
I tried it even by removing gnome. simple cd is not working. am I doing something rong>?
If I try ls, it seems to be working fine!
My main aim is to open a new terminal, and execute commands on that new terminal through the present program that opened the new terminal. Could you please tell me how I can achieve this??
If you want to run a program and wait for it to finish before executing next line, take a look at this page and example code here: http://www.thegeekstuff.com/2012/03/c-process-control-functions/
But if you want to run gnome-terminal and execute a command in newly created window, do this:
system("gnome-terminal -x sh -c 'cd /tmp ; ls -la'");
The system function creates a shell child process to execute the specified command.
cd is a shell command which changes the current working directory of that shell process only.
So the child's cd probably works fine, but it has no effect on your C++ program, which is a different process.
Instead, you probably want to look at the Linux system call chdir.
Thanks for your help!! This command worked perfectly fine from this link
https://superuser.com/questions/198015/open-gnome-terminal-programmatically-and-execute-commands-after-bashrc-was-execu
gnome-terminal -x sh -c 'command1; command2; exec bash'
and I entered the respective commands in the new window. But to change the working directory in the shell am working o, I haven't still figured that out.