Search code examples
mysqlxampp

Restore MYSQL Dump File with Command Line


I have file.sql, and I want to restore it. I found this command:

mysql -u username -p database_name < file.sql

Where should I put 'file.sql' in file system? I'm using Windows and XAMPP. Thank you.

*) The dump file is 3GB++


Solution

  • When I execute the answers of this thread, it returns 'mysql' is not recognized as an internal or external command, operable program or batch file..

    Turned out that I have to execute mysql.exe first in xampp/mysql/bin folder, and the dump file path is relative to this bin folder. I put mine in there, and it worked.

    Thanks all.