Skip to content

Fixing Database Connection working slow on windows 8

Last updated on February 16, 2018

Today I just want to share one useful tip on fixing slow database connection issue on Windows 8 machines.Today I got this issue on my machine after new installation of LAMP stack. After playing around with the configurations of database config file I find a simple fix, We just need to replace the “localhost” with “127.0.0.1” IP, that is it.
With this little trick, you can get rid of the delay between each query execution.

Instead of this:
$mysqli = new mysqli("localhost", "user", "password", "database");

Use this:
$mysqli = new mysqli("127.0.0.1", "user", "password", "database");

If you want to fix the delay on PHP MyAdmin you need to add the following line at the bottom of the “xampp/phpMyAdmin/config.inc.php” file.

$cfg['Servers'][$i]['host'] = '127.0.0.1';

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Most Voted
Newest Oldest
Inline Feedbacks
View all comments