Failed to access phpMyAdmin after password set to database

After I set the password for MySQL, phpMyAdmin denies access to the database and shows the following error:

MySQL said:

1045 - Access denied for user 'root' @ 'localhost' (using password: NO)

I have googled and tried to mess with the configuration file, I tried everything, but could not find a solution. I even considered the previous questions, but the answers there also did not change the situation.

Here is my config.inc.php file:

 <?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'] = 'root'; $cfg['Servers'][$i]['AllowNoPassword'] = true; /* Server parameters */ $cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['compress'] = false; $cfg['Servers'][$i]['extension'] = 'mysql'; $cfg['Servers'][$i]['AllowNoPassword'] = false; /* Select mysqli if your server has it */ $cfg['Servers'][$i]['extension'] = 'mysqli'; /* User for advanced features */ $cfg['Servers'][$i]['controluser'] = 'pma'; $cfg['Servers'][$i]['controlpass'] = 'root'; /* 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'; /* * End of servers configuration */ /* * Directories for saving/loading files from server */ $cfg['UploadDir'] = ''; $cfg['SaveDir'] = ''; $cfg['AllowAnywhereRecoding'] = true; $cfg['DefaultCharset'] = 'utf-8'; $cfg['DefaultLang'] = 'en-utf-8'; $cfg['DefaultConnectionCollation'] = 'utf8_general_ci'; $cfg['MySQLManualBase'] = 'http://dev.mysql.com/doc/refman/5.1/en'; $cfg['MySQLManualType'] = 'searchable'; ?> 
+6
source share
4 answers

Here is the code you should have for phpmyadmin config.inc.php file:

  <?php $i = 0; $i++; $cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['auth_type'] = 'http'; $cfg['Servers'][$i]['compress'] = false; $cfg['Servers'][$i]['extension'] = 'mysql'; $cfg['Servers'][$i]['AllowNoPassword'] = false; ?> 

If you are having problems with the host configuration, you should use:

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

If this does not work, here is another work that does not require any coding:

  • open the /scripts/signon.php page in your browser in the PHPMyAdmin folder
  • enter login information
  • Then another login screen will appear, enter mysql data
+7
source

1) Go to the directory C: \ xampp \ phpMyAdmin and open the file config.inc.php

2) Then find line 21 and change it to (123456 - my mysql user password)

 $cfg['Servers'][$i]['password'] = '123456'; 

3) Then find line 34 and change it to

 $cfg['Servers'][$i]['controlpass'] = '123456'; 

4) Save the file. Then try refreshing the mysql page. This should work in most cases.

+4
source

You can try this too .. Leave the field "Empty field"

 <?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'] = false; $cfg['Lang'] = 'en'; /* 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'; /* * End of servers configuration */ ?> 
0
source

Another option is inside config.inc.php change auth_type to 'cookie'

 $cfg['Servers'][$i]['auth_type'] = 'cookie'; 

Or you can also set auth_type to 'http'

 $cfg['Servers'][$i]['auth_type'] = 'http'; 

Using any method, the next time you log in to phpmyadmin, it should request a username and password.

Source = https://wiki.phpmyadmin.net/pma/Auth_types

0
source

Source: https://habr.com/ru/post/888042/


All Articles