QUICK TIP - The most common errors while importing SQL database WordPress

0 213,567
XAMPP tutorial: create your own local test server | A&H Business Technology
Related posts

There are some common issues while you import your sql database on server or local server XAMPP below and solutions for these.

1. Script timeout passed, if you want to finish import, please resubmit the same file and import will resume.


If you are importing your database using Phpmyadmin, then there’s a configuration file for it:

Open this configuration file in any editor and change $cfg['ExecTimeLimit'] = 300; to $cfg['ExecTimeLimit'] = 0;

Restart your localhost, now you don’t have any time limit.

Or you can use MySQL command line to import your unzipped SQL file directly, something like below:

2. Error during import as description below


Changing php.ini at C:\xampp\php\php.ini

Changing my.ini at C:\xampp\mysql\bin\my.ini

3. Cannot set foreign_key_checks to 0 / off

Changing a session variable like foreign_key_checks last only for the duration of the session. Once you open a new connection, the option defaults to the global value.

PhpMyAdmin, like every PHP application, opens a new connection for every request. So as soon as you change foreign_key_checks, it closes the session for which you changed that option, and your change is over.

If you want to change this option, you’ll have to execute the change as part of the import script, so it gets handled at the beginning of the connection that processes the import.

Another possibility is to change it with SET GLOBAL ..., but this will affect all sessions, not just the one you use for your import. Also, you need the SUPER privilege to change global options, and you seem not to have that privilege.

Edit: Another option is to uncheck “Enable foreign key checks” at the Import stage… Screenshot of Import in phpMyAdmin

4. Error establishing a database connection: WordPress on Webhosting or XAMPP


Check your wp-config.php details like example below:

If you deploy your website on localhost by using XAMPP

You can also check database credentials using php db connection .. create a file called conn.php and add below codes to your file :





If browser print “Connected successfully” then wordpress should work with this also.


TinyURL for this post: https://tinyurl.com/y2td64nn

Sorry, The Comment Form Is Temporarily Closed At This Time
You may also like

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More