How To Export/Import Large Database On MAMP

后端 未结 3 787
暖寄归人
暖寄归人 2021-02-11 05:51

How do I export/import large database on MAMP ? Using PHPMyAdmin does not work as it supposed to be.

3条回答
  •  暖寄归人
    2021-02-11 06:41

    For both operations, open the terminal and type:

    EXPORTING:

    /Applications/MAMP/library/bin/mysqldump -u [USERNAME] -p [DATABASE_NAME] > [PATH_TO_SQL_FILE]

    Then type your password in prompter (default root) and press enter.

    Example:

    /Applications/MAMP/library/bin/mysqldump -u root -p my_database_name > /Applications/MAMP/htdocs/folder_name/exported_db.sql


    IMPORTING:

    /Applications/MAMP/library/bin/mysql -u [USERNAME] -p [DATABASE_NAME] < [PATH_TO_SQL_FILE]

    Then type your password in prompter (default root) and press enter.

    Example:

    /Applications/MAMP/library/bin/mysql -u root -p my_database_name < /Applications/MAMP/htdocs/folder_name/exported_db.sql

    Important Warning: This will erase your current database!

提交回复
热议问题