0
votes

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++

1
Please explain your current situation / scenario. Are you transferring from previous server to a new one? Why such a requirement? The given command is fine. You need to place the sql file in a folder where the apache / httpd user has rights to use. Take care of (all) your database / table's current position as (if) it is clearly in the state prior to your very first command of the sql file. - Natarajan N Napoleon
You can put the file in your desktop or in any other location e.g. in the Documents folder. Use the file explorer, cut your file and move it to either of this locations. Then open the location in terminal and run your commands there. Checkout Using mysqldump - briancollins081

1 Answers

-1
votes

you should navigate to dump file location and run mysql -u username -p database_name < file.sql

for example if your file is at c drive you can open terminal type cd \ (this will go to root folder if your windows is installed on c dirve) and run the above command