### Importing Large SQL Dump Files into MySQL on gptservers.net
Importing large SQL dump files (e.g., backups from WordPress or Joomla) into your MySQL database can exceed phpMyAdmin's upload limits (typically 50MB or less) on your gptservers.net hosting account. Below are two reliable methods to handle this: using **BigDump.php** (a server-side script for staggered imports) or **splitting the SQL file** into smaller chunks for individual uploads. Both approaches bypass server restrictions and ensure a smooth process.
#### Prerequisites
- **MySQL Database**: Create a database, user, and grant permissions via cPanel > **MySQL Databases** (see earlier guides on creating databases and users).
- **SQL Dump File**: Have your `.sql` file ready on your local computer.
- **phpMyAdmin Access**: Log in via cPanel > **phpMyAdmin** for manual imports.
- **File Upload Limits**: Check your hosting plan's limits in cPanel > **Select PHP Version** or contact support@gptservers.net if needed.
**Warning**: Always back up your existing database before importing. Use secure passwords and delete temporary files (e.g., BigDump.php) after use to avoid security risks.
#### Method 1: Using BigDump.php (Staggered Import Script)
BigDump.php is a free PHP script that imports large SQL files in small chunks, restarting automatically to avoid timeouts or memory limits. It's ideal for files over 100MB.
**Steps**:
1. **Download BigDump.php**:
Get the latest version from [http://www.ozerov.de/bigdump.php](http://www.ozerov.de/bigdump.php). Save it to your computer.
2. **Upload Files to Server**:
- Log in to cPanel > **File Manager**.
- Navigate to a temporary folder (e.g., `/public_html/temp/` or create one).
- Upload your SQL dump file (e.g., `backup.sql`) and the `bigdump.php` file.
3. **Edit BigDump.php**:
- In File Manager, right-click `bigdump.php` > **Edit**.
- Update the configuration section at the top:
- `$db_server = 'localhost';` (default for gptservers.net).
- `$db_name = 'cpaneluser_yourdatabase';` (use the full prefixed name from cPanel).
- `$db_username = 'cpaneluser_youruser';` (full prefixed username).
- `$db_password = 'yourpassword';` (from MySQL user creation).
- `$filename = 'backup.sql';` (name of your uploaded SQL file).
- Adjust `$max_query_lines` or `$delay` if needed (defaults work for most cases).
- Save the file.
4. **Run the Import**:
- In your browser, visit `https://yourdomain.com/temp/bigdump.php`.
- The script will start importing in chunks, showing progress (e.g., "Dumping [X] rows"). It auto-restarts sessions.
- Once complete, you'll see a success message.
5. **Clean Up**:
- Delete `bigdump.php` and the SQL file from File Manager to prevent unauthorized access.
- Verify the import in phpMyAdmin > select your database > browse tables.
**Pros**: Handles massive files (gigabytes) without manual intervention.
**Cons**: Requires basic PHP editing; ensure your hosting allows script execution (gptservers.net does).
#### Method 2: Splitting the SQL File into Smaller Chunks
If you prefer not to use scripts, split your SQL file into smaller pieces (e.g., 10–50MB each) using a free tool, then import via phpMyAdmin.
**Steps**:
1. **Download a Splitter Tool**:
Use **SQLDumpSplitter2**, a free Windows-based tool available at [http://www.rusiczki.net/2007/01/24/sql-dump-file-splitter/](http://www.rusiczki.net/2007/01/24/sql-dump-file-splitter/). (For Mac/Linux, use command-line tools like `split -l 10000 backup.sql backup_part_` to split by lines.)
2. **Split the File**:
- Open SQLDumpSplitter2.
- Load your SQL dump file.
- Set the chunk size (e.g., 20MB or 10,000 lines) to stay under phpMyAdmin limits.
- Click **Split** to generate files like `backup_part1.sql`, `backup_part2.sql`, etc.
3. **Upload and Import Chunks**:
- In cPanel > **File Manager**, upload the split files to a temporary folder.
- Go to cPanel > **phpMyAdmin**.
- Select your target database from the left sidebar.
- For each file:
- Click the **Import** tab.
- Choose the file (e.g., `backup_part1.sql`) using **Browse**.
- Set **Format** to SQL.
- Click **Go** to import.
- Repeat for all chunks. phpMyAdmin will combine them seamlessly.
4. **Clean Up**:
- Delete the split files from File Manager.
- Verify the full import in phpMyAdmin.
**Pros**: No server-side scripts needed; works with phpMyAdmin alone.
**Cons**: Manual for large files; requires a local tool.
#### Troubleshooting
- **Upload Fails**: Increase phpMyAdmin limits temporarily in cPanel > **MultiPHP INI Editor** (set `upload_max_filesize` and `post_max_size` to 100M). Restart if needed.
- **Import Errors**: Check for syntax issues in the SQL file (e.g., missing semicolons). Use `--single-transaction` in mysqldump exports for better compatibility.
- **Timeouts**: For very large files, increase `max_execution_time` in the INI Editor (e.g., 300 seconds).
- **Permissions**: Ensure your MySQL user has `ALL PRIVILEGES` on the database (see earlier guide on granting permissions).
- **DNS Propagation**: If the domain is new, wait 24–48 hours.
For assistance with large imports or errors, contact support@gptservers.net with your domain and file details. These methods will save time and ensure successful database migrations on your gptservers.net account!