env: mysql: No such file or directory after `wp import`

后端 未结 3 1800
有刺的猬
有刺的猬 2021-02-04 17:48

I\'m trying to import a database locally using wp db import databasename.sql but I get the following error: env: mysql: No such file or directory. Can

相关标签:
3条回答
  • 2021-02-04 18:24

    For anyone running Desktop Server, which uses XAMPP, your command that needs to be added to .bash_profile with the following command is:

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

    Once you add that, you should be able to use wp db import (and not needing to use the wp-cli portal the Desktop Server provides; which wasn't working consistently for me).

    0 讨论(0)
  • 2021-02-04 18:25

    The above didn't help me. I fixed it by adding this to my .bash_profile:

    export PATH=$PATH:/Applications/MAMP/Library/bin/
    
    0 讨论(0)
  • 2021-02-04 18:26

    I resolved this by changing my $PATH, run this in command or update your .bash_profile:

    export PATH=$PATH:/usr/local/mysql/bin
    
    0 讨论(0)
提交回复
热议问题