After like three (3) hours of google..ing.This is the solution to the problem: First, I run this command;
$mysqladmin -u root -p[your root password here] version
Which outputs:
Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Server version 5.5.49-0ubuntu0.14.04.1
Protocol version 10
Connection Localhost via UNIX socket
UNIX socket /var/run/mysqld/mysqld.sock
Uptime: 1 hour 54 min 3 sec
Finally, I changed the connect_type
parameter from tcp
to socket
and added the parameter socket
in config.inc.php
:
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['connect_type'] = 'socket';
$cfg['Servers'][$i]['socket'] = '/var/run/mysqld/mysqld.sock';
All credit goes to this person: This is the correct solution