Reputation: 1827
I have installed the latest XAMPP with MySQL version 14.14 Distrib 5.6.21, the problem is in my computer, I already have a MySQL database installed by other program that I am using.
So I configure the XAMPP MySQL port to 3307 (default is 3306) inside the my.ini
file. However, now my localhost/phpmyadmin seems to read the database installed by the other program, not the one in XAMPP, and also when I test using some PHP files, it shows that I am connected to the database even though XAMPP is turned off (XAMPP MySQL also disconnected).
How do I change the setting of my PHPMyAdmin and localhost to connect to the MySQL port 3307?
I don't understand how all these ports and the database work.
Upvotes: 22
Views: 107019
Reputation: 1
To configure PHPMyAdmin to connect to MySQL on port 3307:
Open the config.inc.php file in the PHPMyAdmin directory :
C:\xampp\phpMyAdmin\config.inc.php
Find the line containing $cfg['Servers'][$i]['host'] and set it to 'localhost:3307':
$cfg['Servers'][$i]['host'] = 'localhost:3307';
Ensure the port is set correctly in $cfg['Servers'][$i]['port']:
$cfg['Servers'][$i]['port'] = '3307';
Save the file. After making these changes, PHPMyAdmin should connect to the MySQL database on port 3307.
Upvotes: 0
Reputation: 1
/* Authentication type and info */
$cfg['Servers'][$i]['auth_type'] = 'config';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
$cfg['Servers'][$i]['extension'] = 'mysqli';
$cfg['Servers'][$i]['AllowNoPassword'] = true;
$cfg['Lang'] = '';
/* Bind to the localhost ipv4 address and tcp */
$cfg['Servers'][$i]['host'] = '127.0.0.1:3307'; /* change port is here */
$cfg['Servers'][$i]['connect_type'] = 'tcp';
Upvotes: -1
Reputation: 741
First open the following path:
C:\xampp\phpMyAdmin
Add the following string in config.inc.php file.
$cfg['Servers'][$i]['port'] = '3307';
Upvotes: 5
Reputation: 16
Add below line under phpMyAdmin/config.inc.php
$cfg['Servers'][$i]['port'] = port number;
in my case the port number is 8111
.
Upvotes: 0
Reputation: 1
The following worked for me, I just added my port code to:
$cfg['Servers'][$i]['host'] = '127.0.0.1:3308';
Upvotes: 0
Reputation: 725
Goto xampp>phpMyAdmin
Directory.
Find the config.inc.php
file.
Now change this line:
$cfg['Servers'][$i]['host'] = '127.0.0.1';
To
$cfg['Servers'][$i]['host'] = '127.0.0.1:3307';
Upvotes: 46
Reputation: 12422
To configure phpMyAdmin to connect to a different port from the default, edit your config.inc.php
file and add a line like:
$cfg['Servers'][$i]['port'] = '3307';
(of course substituting any port number as needed). You can also see the official documentation.
Upvotes: 6