Unfortunately I have a SQL file more than 350 MB. I have to import this file on the server to connect the database with one of my clients website. How I can do this? If it was my PC, then I can easily do it by editing the php.ini file. But it’s in the live server and the sql file upload limit is only 50 MB. What can I do? I have the cPanel and also the server access. Can anyone help me? Thanks in advance.
2
Answers
If you have SSH access then login to MySQL server and use the following command:
This is only basic for more detail you can find here
Assuming you have FTP access but don’t have SSH command-line access, which is often the case with shared servers:
PHP is often set to a relatively short timeout to avoid runaway scripts. So you may want to add a set_time_limit() call inside your main loop so that it won’t be aborted in the middle.
I also recommend using a counter in the loop to track lines processed. If you get a SQL error then report it (mysqli_error() or similar function) along with the line count. That way you can edit your file locally, find/fix the problem and upload only the unprocessed data to try again.