How to Import Large SQL file in mysql in Xampp Server
- Open Command Prompt
- Type: cd c:\xampp\mysql\bin
- Now I am showing you main command for import SQL file with the explanation .
- mysql -u {DB-USER-NAME} -p {DB-NAME} < {db.file.sql path}
- or if it's on a remote server use the -h flag to specify the host.
- mysql -u {DB-USER-NAME} -h {MySQL-SERVER-HOST-NAME} -p {DB-NAME} < {db.file.sql path}
- In my case i used this command to import sql.
- mysql -u root -p opencart < client_db_file.sql
- here i directly put sql file in this folder c:/xampp/mysql/bin since while I was putting path it was not working for me. so I moved the SQL file in the same folder and it worked perfectly for me.
Enjoy 😅😆