简体   繁体   English

如何在Mac OS的XAMPP下运行mysqldump

[英]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". 我想在Mac OS中运行mysqldump命令,我能够找到文件的位置为“ / 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 . * NIX系统上执行操作时的窍门是,您必须准确地告诉Shell文件在哪里,或者它必须在$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: 如果要创建它,那么只需输入命令而不给出位置,就可以将其添加到PATH变量中:

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. 同样在Mac上,您只需将文件从finder拖放到终端中即可。 This will automatically type the path for you. 这将自动为您键入路径。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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