How to Import a Database in phpMyAdmin on HostGator
Most database migrations arrive as a single .sql file exported from the old server, with the rest of the site copied across as a folder of images, themes and plugins. The SQL file is usually the heavier piece of work, because phpMyAdmin does not explain itself: it talks about queries, privileges and character sets without translating them. Get it right and the new site behaves exactly like the old one; get it wrong and the front page throws an "Error establishing a database connection" on a domain you have already paid for. Learn more about How To Manage Dns Zones On Hostgator.html.
This guide walks the whole sequence on HostGator's shared cPanel hosting — creating an empty database, attaching a user to it, loading the dump through phpMyAdmin, and confirming the records match what you exported. It is written for people running sites in Australia: a Melbourne retailer moving off a slow in-house box, a Canberra consultancy, or a developer rebuilding a client's site at midnight AEST. Learn more about Online Casino Vip Program.html.
Before you begin: collect the dump and a clean slate
Export a fresh backup from the old server first. In the old phpMyAdmin, select the database, click Export, choose Quick, keep the option that adds DROP statements ticked, and save the file to your own machine rather than emailing it to yourself. If the source site is live — and most Australian small business sites are — take that export in a quiet window so a customer order written after the snapshot is not missing from the file. Note the timestamp in Australian Eastern Standard Time so you can identify exactly which snapshot you loaded later.
Watch the size of the file. Shared hosting caps PHP uploads, and phpMyAdmin's import usually gives up somewhere around 50 MB, which a single WooCommerce store can cross easily. Compress the dump to .sql.gz before uploading; phpMyAdmin reads compressed archives natively, and a 120 MB export often shrinks to under 20 MB. That matters if you are working from a mobile hotspot on a capped plan in regional Victoria or Queensland rather than fixed NBN.
Keep the archive out of public_html and off shared cloud drives with public links. Australian businesses holding customer records are bound by the Privacy Act 1988 and the Australian Privacy Principles, and a .sql dump sitting in a web-accessible folder is a compliance problem as much as a security one.
Signing in to cPanel and opening phpMyAdmin
HostGator's shared plans run cPanel. Sign in with the credentials from your welcome email, usually at https://yourdomain.com:2083, and the control panel appears with icons for Files, Mail, Domains and Databases. The customer area also links out to billing and invoices, domain purchase or transfer, video tutorials, the knowledge base, ticket support and the online forums, which is worth bookmarking before you start.
In cPanel, scroll to the Databases section and click phpMyAdmin; some accounts open it directly at cpanel.yourdomain.com/pma. The left sidebar lists every database on the account. If that list is empty, or shows only information_schema, nothing usable has been created yet.
Before loading anything, confirm the domain actually points at HostGator. If the records still point to the previous host, pages will keep serving the old site while the new database fills up. The walkthrough on DNS zone management explains where to check the A records and nameservers from inside cPanel. Australian domains add a wrinkle: a .com.au registration needs an ABN or ACN, and .au direct registrations follow auDA's eligibility rules, so finish a domain purchase or transfer from another registrar before you cut over the data.
Creating the database, user and privileges
Open cPanel's MySQL Databases tool, give the new database a short descriptive name and let cPanel apply its prefix. The final name usually looks like cpaneluser_shop42, and that exact string is what you copy into the site's configuration file later. Use a new name rather than an existing one; importing over a populated database is how live data gets wiped.
Next, create a MySQL user with a long passphrase — Australian sites attract the same automated credential-stuffing attempts as everyone else's, and a 20-character passphrase beats Summer2024 every time. Add that user to the new database with All Privileges, then write down the database name, username, password and host. On HostGator shared hosting the host is localhost in almost every case, and the cPanel password is not the same thing as any password you type into the phpMyAdmin login screen.
One practical note on money: HostGator bills Australian customers in Australian dollars, with GST applied to hosting invoices, and the amount appears in the billing portal and on the invoice PDF you can download from there.
Importing the SQL file step by step
Return to phpMyAdmin and click the name of your new database in the left sidebar. Selecting the right entry is the single most common mistake in the whole process — importing into nothing, or into the wrong schema, produces confusing results later. With the database highlighted, open the Import tab along the top of the screen.
Click Choose File and select your .sql or .sql.gz archive. Set Format to SQL. For Character set of the file choose utf8mb4 for a modern WordPress or WooCommerce dump, and match the SET NAMES line inside the file if it says something older, such as latin1. Leave the SQL compatibility options alone unless you have a reason to change them. Then press Import at the bottom right, or Go, depending on the phpMyAdmin version.
The work happens on the server, so the browser sits quiet while the file is processed. A successful run ends with a green banner reporting the number of queries executed and the elapsed time. If the file is large enough to exceed the PHP execution limit, the request can time out halfway and leave you with a partial load — which is why compressing the archive and checking sizes before clicking Import is worth the extra minute.
Comparing the routes into phpMyAdmin
phpMyAdmin offers several doors, and the sensible one depends on the size of the dump and whether the account has shell access.
| Route | Best suited to | Practical notes | Watch out for |
|---|---|---|---|
| Import tab, file upload | Small to medium dumps within the PHP upload limit | Point-and-point, no terminal required | Fails or times out on very large files |
Import tab with a .sql.gz archive |
Large WordPress or WooCommerce dumps over modest broadband | phpMyAdmin decompresses on the server | A dropped upload leaves a partial load that must be re-run |
| Pasting SQL into the query box | Single statements, patches, one INSERT |
Immediate syntax feedback | Browser and PHP timeouts make it impractical for full dumps |
mysql client over SSH |
Full migrations and very large archives | Fastest option, scripts are repeatable | Shell access is not included on every shared plan |
| Migration plugin or restore tool | Managed moves from another host | Can carry rewrites and serialised options | Needs credentials for both servers and may skip custom fields |
For most people working on a small business site, the compressed import is the sweet spot. Reach for SSH when the archive runs to hundreds of megabytes, and check whether HostGator's migration service suits a full WordPress move better than a manual load.
Checking the imported data and fixing common errors
Open the database in phpMyAdmin and click Structure. You are looking for the same set of objects you saw on the old server, with matching row counts when you run SELECT COUNT(*) on the busiest ones. Then spot-check real records: an Australian store should show recent orders with Melbourne or Sydney suburbs, GST-inclusive totals and timestamps that line up with local time. Numbers that look right in aggregate can still hide a truncated table.
Then load the new site in an incognito window. "Error establishing a database connection" means the configuration file still carries the old database name, user or password. A page that renders but an empty admin screen means the data landed while the application reads a different schema. For WordPress, run the database repair tool under Tools in wp-admin, then clear the cache and reload permalinks.
Real migrations carry more than rows and columns. A client running an online casino VIP program has member profiles, tier assignments, bonus balances and an audit trail of transactions, and every one of those categories needs reconciling rather than simply loading. Booking systems, membership portals and CRMs behave the same way.
The error strings worth recognising are short. "Unknown character set" points to the header of the dump; "Table already exists" means you loaded into a populated schema, so start with a fresh database name or use the drop option; "MySQL server has gone away" is a timeout; "Access denied for user" means the user was never attached to the database.
Your next step after a clean import
Once the data checks out, update the configuration file with the new database name, username and password, purge the cache, and browse the site as a visitor would. Test the homepage, one inner page, the contact form and, for a store, one real order through to the inbox. Check the domain's SSL certificate at the same time, because a database import does nothing for a browser warning on the checkout page.
The concrete step that protects everything you have just loaded is to take a fresh export before touching anything else. Open phpMyAdmin, select the imported database, click Export, choose the Custom option with every object included, and save it as sql/hostgator-import-YYYY-MM-DD.sql in a folder kept outside public_html and stored with the site's documentation. That snapshot becomes the known-good baseline you can restore from if a later plugin update, a failed migration or a stray delete empties the schema.