I have installed MySQL server enterprise 5.1 on my local machine and now I want to install phpMyAdmin, but it does not work.
I have unrared phpMyAdmin to my server r
Right-click My Computer -> Manage -> Services Choose "Services" under the "Services and Application" from right pane Then search for the "mysql" Service. When you find it, double click to start that service.
Now you should be able to run and login to PhpMyAdmin
This is old but as it is the first result in Google,
Please note that this also happens when your MySql service is down,
I fixed this by simply restarting MySQL Server using:
/etc/init.d/mysql restart
in SSH (Command is for a CentOS/CPanel server)
Had this problem a number of times on our setup, so I've made a check list.
This assumes you want phpMyAdmin connecting locally to MySQL using a UNIX socket rather than TCP/IP.
UNIX sockets should be slightly faster as they have less overhead and can be more secure as they can only be accessed locally.
Service
service mysqld status
service mysqld start
service mysqld restart
MySQL Config (my.cnf)
protocol=tcp
PHP Config (php.ini)
If you can connect locally from the command line, but not from phpMyAdmin, and the socket file is not in the default location:
mysqli.default_socket = *location*
pdo_myql.default_socket
and mysql.default_socket
just to be sureservice httpd restart
phpMyAdmin Config (config.inc.php)
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['socket'] = '*location*';
N.B.
As pointed out by @chk; Setting the $cfg['Servers'][$i]['host']
from localhost
to 127.0.0.1
just causes the connection to use TCP/IP rather than using the socket and is more of a workaround than a solution.
The MySQL config setting bind-address=
also only affects TCP/IP connections.
If you don't need remote connections, it is recommended to turn off TCP/IP listening with skip-networking
.
Check whether you server is running or not.
In ubuntu OS in '/etc/php5/apache2/php.ini' file do configurations that this page said.
If you're getting the #2002 Cannot log in to the MySQL server
error while logging in to phpmyadmin, try editing phpmyadmin/config.inc.php
and change:
$cfg['Servers'][$i]['host'] = 'localhost';
to:
$cfg['Servers'][$i]['host'] = '127.0.0.1';
Solution from Ryan's blog
Edit (20-Mar-2015):
Note that if you're on a fresh install, config.inc.php may not exist. You need to rename / copy config.sample.inc.php and then change the relevant line