replace these given variable with yours $filename = 'mysql.sql'; $mysql_username = 'root'; $mysql_password = ''; $mysql_database = 'wpsite4'; and put the sql file in the same folder. and run this php file you are all done.
or use can use this tutorial https://thecodedeveloper.com/import-large-sql-files-xampp/