简体   繁体   中英

How to run mysqldump under XAMPP on Mac OS

I want to run the mysqldump command in Mac OS, I am able to find the location of the file as "/Application/XAMPP/xamppfiles/bin".

But don't know how to exec the same from command prompt, as it says command not find, by simply typing it and executing it from the prompt/

The trick on *NIX systems when executing things is that you have to tell the shell exactly where the file is, or it must be in your $PATH .

This should work:

/Application/XAMPP/xamppfiles/bin/mysqldump

This would also work:

 cd /Application/XAMPP/xamppfiles/bin/
 ./mysqldump

If you want to make it so you can just type the command without giving the location, add it to your PATH variable:

export PATH=$PATH:/Application/XAMPP/xamppfiles/bin

And then just run it!

mysqldump

Also on Mac you can simply drag and drop the file from finder right into the terminal. This will automatically type the path for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM