mysqldump: command not found XAMPP - shell

I'm trying to use a script in grunt and node to dump a database.
When I run It return me this error:
/bin/sh: mysqldump: command not found
I have already contacted the creator of the script and we have understand that the problem is the configuration of my localhost.
I'm using XAMPP 1.8.2-3 in OSX
How can I use correctly mysqldump
Thanks

Try:
export PATH=$PATH:/Applications/XAMPP/bin
Then run your script.
So you don't have to do this in the future, check your .profile file in your home directory. There should be a line that starts with export PATH, something like (only an example):
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
Just add your XAMPP path to it:
export PATH=/opt/local/bin:/opt/local/sbin:/Applications/XAMPP/bin:$PATH
The different directories are separated by colons only, don't add any whitespace.

Related

Command can't be found in zsh on windows

I'm trying to complete configuration of zsh. When I run commands in git-bash, it's OK. However, the error "zsh: command not fount" is reported when I run these commands in zsh itself. Then I check the file ".zshrc" and find the path exported may get wrong.
export PATH=$HOME/bin:/usr/local/bin:$PATH
These files are located in another directory but not in "$HOME". But I don't know how to alter the line.

zsh: command not found on MacOS Monterey

I wanted to create a react project and when I executed the command it said zsh: command not found: npx
Then I tried the ls command and it said zsh: command not found: ls.
After setting the export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" command both the ls and npx create-react-app command worked fine and when close the terminal and reopen again, the same command not found error shows.
Is there any permenent fix without setting export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" command
For adding the variables to the path you need to add it to zshrc file for making that variable available locally.
The way you have used will only work until you use it in the same terminal window path only.
To solve the problem, follow these steps:
Goto you home directory
Simultaneously press cmd + shift + (.) Note:the last key is the key of dot
On following step 2, new hidden files will appear in home directory, look for (.zshrc) file and open it using any text editor.
Add your path variable in it, save and then close it.
Example: export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
Open terminal and run the command: "echo $PATH" and see if your added variable is present in the output shown by terminal.
If yes, You are now ready to go to use it from anywhere in terminal now.
This is what worked for me on macOS Monterey,
Although I added the path to ./zshrc and sourced the file, after reopening the terminal the PATH was not exported
I followed these steps to solve this
Created .zprofile with touch .zprofile at the home directory. If the file already exists use that.
Add the required path to this file using vim or nano
eg: export PATH=${PATH}:/Users/Development/HashBaze/flutter/bin
If the above two steps don't work try sourcing both the .zprofile and .zshrc after following the above two steps.
This solution worked for me on macOS Monterey version 12.5

ls,sudo commands not found (shell commands)

I tried to install laravel Framework in my mac OSX 10 .And I ended modifying my ~/.bash_profile to add the laravel command. laravel command seems to work normally .But another problem came out . ls ,sudo ...and other shell commands does not work .
-bash: ls: command not found
My bash.profile file contains the two links
export PATH="/Applications/MAMP/bin/php/php5.6/bin"
export PATH="$PATH:$HOME/.composer/vendor/bin"
check in ~/.bash_profile if this PATHs exist
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
your complete line should looks like this
export PATH=/Applications/MAMP/bin/php/php5.6/bin:$HOME/.composer/vendor/bin:/opt/local/bin:/opt/local/sbin:$PATH
reboot needed.
The binaries for the above mentioned utilities for debian distribution are usually in /bin or /usr/bin directory. Of course exporting path won't help if the binaries are not there.
There could be one simple approach to it -
Check for the location of binaries and then export the path in the bash_profile or .bashrc.
Run the bashrc script (. ~/.bashrc) following you may not require a reboot.

Terminal is not working as usual mac after trying to install CakePHP

I was downloading the CakePHP framework for a project. Below the steps:
Installation
1) Install PHP 5.6 from: http://php-osx.liip.ch/
curl -s http://php-osx.liip.ch/install.sh | bash -s 5.6
2) add the updated PHP version to our path. So we edit .profile file
nano ~/.profile
Add into the file
export PATH= /usr/local/php5/bin:$PATH
Then hit Control + O to write out the file
Then hit Control + X to save the file
exit
Restart the Terminal
Now the terminal doesn't work as usually. I've tried to understand the shell concept and apply different solutions, but I can't even find the .profile file again.
I obtain errors like:
enter code here-bash: ls: command not found
Anybody can explain me what's wrong and the shell concept to properly understand shell (-bash)?
The problem is this:
export PATH= /usr/local/php5/bin:$PATH
You killed your PATH variable. You need to find a way to edit .profile file, and change that line to:
export PATH=$PATH:/usr/local/php5/bin
You could try editing with the following command (using vim):
/usr/bin/vim /Users/yourname/.profile
Or (using nano):
/usr/bin/nano /Users/yourname/.profile
Or just remove .profile file completely by doing /bin/rm /Users/yourname/.profile. Of course, in any case, you need to restart your terminal once you're done.

Export environment variable Mac

I am starting with spring-roo, so I downloaded it and now I'm trying to export the variable.
To get it, I tried:
PATH=$PATH:/Users/myUsr/spring-roo/bin
export PATH
PATH variable
my-Name-3:~ myUsr$ echo $PATH
/sw/bin:/sw/sbin:/usr/local/mysql/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/X11R6/bin:/Users/myUsr/spring-roo/bin
In this path (/Users/myUsr/spring-roo/bin), there is roo.sh
But then, I can not run the command roo as it is supposed to be.
You are not supposed to be able to run a command roo (no .sh), when all you have is roo.sh. Run roo.sh instead. There is no magic dropping of extensions in Unix.
Are you in the directory where the root.sh is ? Just give a try by being in that directory to run the shell script. Also check the permissions of the file.

Resources