I keep getting the following errors with mysql connection through XAMPP and I don\'t know what to do:
That\'s the code in the config.inc.php
clear site data in your browser. and it will be fixed. sometimes when you run proxies, vpns or some other programs this error happens.
if your port is 3307 (based on your port)
Add this line in xampp\phpMyAdmin\config.inc: after i++
$cfg['Servers'][$i]['port'] = '3307';
Might be late to the party - also, this answer is for LAMP users who got to this thread from google, like me.
Basically, the problem is PMA is trying to connect to SQL with a user that doesn't exist.
At /etc/phpmyadmin/config-db.php, you will find 2 variables: $dbuser, and $dbpass. Those specify the MySQL user and Password that PMA is trying to connect with.
Now, connect with some username/password that work (or just "root" if you are connecting from localhost), create a new user with global priviliges (e.g - %PMA User% with password %Some Random Password%), then in the above mentioned file set:
$dbuser = %PMA User% ;
$dbpass = %Some Random Password%;
You might also change other stuff there, like the server address ($dbserver), the port ($dbport, which might not be the default one on your machine), and more.
Linux / Ubuntu:
If installed phpmyadmin via apt:
sudo apt-get install phpmyadmin php-mbstring
Can check /etc/phpmyadmin/config-db.php
for changing the user credentials.
$dbuser='pma';
$dbpass='my_pass';
$basepath='';
$dbname='phpmyadmin';
$dbserver='localhost';
$dbport='3306';
$dbtype='mysql';
consider changing host entry 127.0.0.1
to localhost
or even the IP address of the server.
$cfg['Servers'][$i]['host']
Add this line to the file xampp\phpMyAdmin\config.inc
:
$cfg['Servers'][$i]['port'] = '3307';
Here, my port is 3307
, you can change it to yours.