4

I change the ip address of my apache in my xampp but i cannot connect to my MySQL. I think the problem is that my apache is not on the same network in my database. My apache is on 192.168.1.10. while my MySQL is on 127.0.0.1. Please help me. I don't know what to do. Thankyou.

HoldOffHunger
  • 18,769
  • 10
  • 104
  • 133
Jemuel Elimanco
  • 416
  • 2
  • 4
  • 20

2 Answers2

6

search for config.inc.php in phpmyadmin folder

and change this

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

Ehab Eldeeb
  • 722
  • 4
  • 12
  • I do it but I cannot access my phpMyAdmin now. what should i do? – Jemuel Elimanco Jul 21 '15 at 14:52
  • I'm using windows 8.1. This is the message: #1130 - Host 'Jemzz' is not allowed to connect to this MySQL server. Connection for controluser as defined in your configuration failed. phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server. – Jemuel Elimanco Jul 21 '15 at 15:08
  • either the host is incorrect, or you don't allow remote connections on the machine that hosts the sql server – Ehab Eldeeb Jul 21 '15 at 15:52
0

For the version of phpmyadmin I had installed (4.6.6) the configuration file was at

/etc/phpmyadmin/config-db.php

It looks like:

<?php
##
## database access settings in php format
## automatically generated from /etc/dbconfig-common/phpmyadmin.conf
## by /usr/sbin/dbconfig-generate-include
##
## by default this file is managed via ucf, so you shouldn't have to
## worry about manual changes being silently discarded.  *however*,
## you'll probably also want to edit the configuration file mentioned
## above too.
##
$dbuser='phpmyadmin';
$dbpass='myrealpassword';
$basepath='';
$dbname='phpmyadmin';
$dbserver='localhost';
$dbport='3306';
$dbtype='mysql';

And then obviously you just change dbserver to 127.0.0.1 . This is especially useful if you've turned of mysql name resolution by setting skip-name-resolve=1 in the mysql configuration file

/etc/mysql/mysql.conf.d/mysqld.cnf

user2682863
  • 3,097
  • 1
  • 24
  • 38