Phpmyadmin in WAMP error # 1045 - password reset required

I recently reinstalled WAMP on my PC and copied the files from the backup that I had. I can access localhost without any problems, and my existing sites are functioning fine.

The problem is that I cannot log in through http://localhost/phpmyadmin/index.php . I get # 1045 Cannot enter MySQL server response .

After doing some readings, I was lucky that I can edit the phpmyadmin config.inc.php file to configure the settings. After installing my files (as described below) I just get the error message Unable to connect: invalid. .

  <?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]['AllowNoPasswordRoot'] = true; /* 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'; /* * End of servers configuration */ ?> 

Can someone please indicate what I can do to solve the problem?

I am running WAMP 2 using PHP 5.4.12 and mySQL 5.6.12. I also tried logging into the mySQL console in WAMP, but I can not get past the password request ...

+4
source share
3 answers

If the problem is just a forgotten password, this will allow you to reset it. However, if you have mixed incompatible databases with versions of MySQL Server, you will have other problems if you have a reset password.

Stop mysql service

wampmanager -> MySQL -> Service -> Stop Service

Edit my.ini file

wampmanager -> MySQL -> my.ini

Locate the [wampmysqld] section in the ini file. Add this line immediately after the [wampmysqld] section [wampmysqld]

 skip-grant-tables 

Restart the mysql service. wampmanager -> MySQL -> Service -> Start/Resume Service

Open the MySQL console wampmanager -> MySQL -> MySQL Console

Now we move on to reset the password for the root user, of course, this can be used to reset any user. Type the following two commands at the mysql> prompt, each of which has a colon at the end of the line, and press Enter after each line to issue the mysql command.

For MySQL versions up to 5.7.0

 UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root'; FLUSH PRIVILEGES; 

For versions of MySQL after 5.7.0

 UPDATE mysql.user SET authentication_string = PASSWORD('MyNewPass'), password_expired = 'N' WHERE User = 'root'; FLUSH PRIVILEGES; 

Note that the update should report that it has updated more than one row, that is, because there are actually 3 user accounts with the user ID "root" each with a different domain

i.e. 127.0.0.1, localhost and :: 1 *

Now enter "quit" in the mysql promt command to make mysql exist.

Stop mysql wampmanager -> MySQL -> Service -> Stop Service

Edit the file my.ini wampmanager -> MySQL -> my.ini

Find the [wampmysqld] section in the ini file. Remove the skip-grant-tables parameter that we added earlier.

DO NOT leave this parameter in the ini file with its HUGH protective hole.

Restart the mysql service. wampmanager -> MySQL -> Service -> Start/Resume Service

+18
source

I ran into a problem. Unfortunately, my root username and password = '' did not work. I use the following solution and its work for me. You can try your luck.

1) Click the wamp icon (next to the time, bottom right on your laptop)

2) Go to "MySQL" and click "MySQL Console".

enter image description here

After opening the terminal, enter these three commands.

 mysql> SET PASSWORD for 'root'@'localhost' = ''; mysql> SET PASSWORD for 'root'@'127.0.0.1' = ''; mysql> SET PASSWORD for 'root'@'::1' = ''; 

NOTE. You do not need to write mysql> .. It will already be. :)

Now restart your wap. go to localhost / phpmyadmin, enter the username "root" and leave the password blank.

If the answer works for you, be sure to vote for it.

BEST GOOD LUCK.

+2
source

For above MySQL 5.7

 UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE User='root'; 

need to change to -

 update user set authentication_string=password('MyNewPass') where user='root'; 
+1
source

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


All Articles