5

MySQL was working fine and then for no reason I start getting this error whenever I open http://localhost/phpmyadmin/

enter image description here

I spent hours here trying to find solutions but all what I've tried did not work.

can someone please help me?

I am using: XAMPP Version: 7.3.6

Thanks

config.inc.php file content

<?php
/*
 * This is needed for cookie based authentication to encrypt password in
 * cookie
 */
$cfg['blowfish_secret'] = 'xampp'; /* YOU SHOULD CHANGE THIS FOR A MORE SECURE COOKIE AUTH! */

/*
 * Servers configuration
 */
$i = 0;

/*
 * First server
 */
$i++;

/* 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';
$cfg['Servers'][$i]['connect_type'] = 'tcp';

/* User for advanced features */
$cfg['Servers'][$i]['controluser'] = 'pma';
$cfg['Servers'][$i]['controlpass'] = '';

/* Advanced phpMyAdmin features */
$cfg['Servers'][$i]['pmadb'] = 'phpmyadmin';
$cfg['Servers'][$i]['bookmarktable'] = 'pma__bookmark';
$cfg['Servers'][$i]['relation'] = 'pma__relation';
$cfg['Servers'][$i]['table_info'] = 'pma__table_info';
$cfg['Servers'][$i]['table_coords'] = 'pma__table_coords';
$cfg['Servers'][$i]['pdf_pages'] = 'pma__pdf_pages';
$cfg['Servers'][$i]['column_info'] = 'pma__column_info';
$cfg['Servers'][$i]['history'] = 'pma__history';
$cfg['Servers'][$i]['designer_coords'] = 'pma__designer_coords';
$cfg['Servers'][$i]['tracking'] = 'pma__tracking';
$cfg['Servers'][$i]['userconfig'] = 'pma__userconfig';
$cfg['Servers'][$i]['recent'] = 'pma__recent';
$cfg['Servers'][$i]['table_uiprefs'] = 'pma__table_uiprefs';
$cfg['Servers'][$i]['users'] = 'pma__users';
$cfg['Servers'][$i]['usergroups'] = 'pma__usergroups';
$cfg['Servers'][$i]['navigationhiding'] = 'pma__navigationhiding';
$cfg['Servers'][$i]['savedsearches'] = 'pma__savedsearches';
$cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
$cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
$cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
$cfg['Servers'][$i]['favorite'] = 'pma__favorite';

/*
 * End of servers configuration
 */

?>
SULTAN
  • 1,119
  • 4
  • 12
  • 25
  • Please restart your machine and open phpmyadmin – SAVe Jul 10 '19 at 14:23
  • @SAVe done that and did not solve the problem – SULTAN Jul 10 '19 at 14:48
  • FYI, I uninstall and reinstall the MySQL again and the same thing keeps coming – SULTAN Jul 18 '19 at 05:43
  • Have you tried changing `$cfg['Servers'][$i]['host'] = '127.0.0.1';` to `… = 'localhost';`? – Arth Jul 18 '19 at 11:22
  • Also it might be worth running `SELECT User, Host FROM mysql.user` if you can get in on the command line to check which users are available – Arth Jul 18 '19 at 11:29
  • As it's complaining about it, I'd drop the lines for `'controluser'` and `'controlpass'` too.. you shouldn't need them to login (you can reconfigure later if necessary) – Arth Jul 18 '19 at 11:35

7 Answers7

16

SOLUTION - TRIED AND TESTED.

open folder >> C:\xampp\mysql\bin open file (edit) >> my.ini

Add this line

# The MySQL server
default-character-set=utf8mb4
[mysqld]
skip-grant-tables   <<<--- Add this line
port=3306

Save file.

Restart XAMPP. Go to http://localhost/phpmyadmin/

And there you have it.

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
Terence - AI FX
  • 185
  • 1
  • 7
0
$cfg['Servers'][$i]['AllowNoPassword'] = true;   <--- change this
$cfg['Servers'][$i]['AllowNoPassword'] = false;  <--- to this fixed the problem.

Note: there are other areas in localhost where you have to change the password manually. For example in "CD Collection" example. The password is hard coded there rather than picking it up from config.inc.php.

Hussam Adil
  • 502
  • 7
  • 13
  • When changing the AllowNoPassword to false I get 2 errors: {Cannot connect: invalid settings.} and {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.} – SULTAN Jul 18 '19 at 06:38
0

enter image description here

Run this command

 mysqladmin -u root password 'mynewpassword'
Md Majadul Islam
  • 125
  • 1
  • 11
  • this is what I am getting: mysqladmin: connect to server at 'localhost' failed error: 'Host 'localhost' is not allowed to connect to this MariaDB server' – SULTAN Jul 18 '19 at 06:33
0

Possibly a security precaution. You could try adding a new administrator account:

mysql> CREATE USER 'monty'@'localhost' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'localhost'
    ->     WITH GRANT OPTION;
mysql> CREATE USER 'monty'@'%' IDENTIFIED BY 'some_pass';
mysql> GRANT ALL PRIVILEGES ON *.* TO 'monty'@'%'
    ->     WITH GRANT OPTION;

https://stackoverflow.com/a/1559992/7528823

user229044
  • 232,980
  • 40
  • 330
  • 338
Alen Simonyan
  • 360
  • 2
  • 9
0

I do not know why but for some reasons when I start XAMPP control panel as Administrator I can connect to phpMyAdmin with no issues

SULTAN
  • 1,119
  • 4
  • 12
  • 25
0

The error messages are a bit confusing as it mentions MariaDb server. There was a change to WAMP server recently to allow MariaDb, don't know if XAMPP did the same. WAMP server switch MySQL to MariaDB

Given that it works when you run as Administrator, I'd say it cannot access a settings file when run as normal. Can you check the permissions on config.inc.php?

When it does connect as administrator: do you have to enter your mySql username and password? what do you see in the database panel? Server: Local Databases (127.0.0.1 via TCP/IP) Server type: MySQL Server version: 5.7.14 - MySQL Community Server (GPL) Protocol version: 10 User: root@localhost Server charset: UTF-8 Unicode (utf8), example:

Paul McCarthy
  • 818
  • 9
  • 24
0

I just encountered same problem a few minutes ago, i was sure i didnt need any configuration change so what i did was to clear cookies and site data from 127.0.0.1 (might be localhost instead, in your case) and it was solved!