Mysqldump command not found

前端 未结 7 2115
再見小時候
再見小時候 2020-12-31 01:36

I want to export my database and i am using this code:

mysqldump -p -u markazo_b markazo_b > /tmp/file.sql

But SSH show this error:

7条回答
  •  梦毁少年i
    2020-12-31 02:02

    For OS X and MAMP (localhost) open Terminal and run

    sudo nano ~/.bash_profile
    

    Add the following code (make sure to change the -uroot -proot by the username and password you have for mysql):

    alias mysqldump='/Applications/MAMP/Library/bin/mysqldump --host=localhost -uroot -proot'
    

    Once added, Press Ctrl + O to save then Ctrl X to leave the editor, now run on the terminal

    mysqldump dbname > dump_name.sql
    

    That worked perfectly for me.

提交回复
热议问题