How do I recover/ change my phpmyadmin password on Wampserver.
Posted by: stankovic1 (197.210.29.---)
Date: October 08, 2016 10:05PM

forgot my phpmyadmin password on Wampserver. What can I do? I need some help with this.

Options: ReplyQuote
Re: How do I recover/ change my phpmyadmin password on Wampserver.
Posted by: RiggsFolly (Moderator)
Date: October 09, 2016 12:48AM

See [stackoverflow.com]

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: How do I recover/ change my phpmyadmin password on Wampserver.
Posted by: stankovic1 (197.210.29.---)
Date: October 09, 2016 09:59AM

Hi @riggsfolly, nice to see you replied here also. So here's the thing. I finally figured it out, I didn't select a database to implement the changes, I did that by running the command "show database", a list of my created databases appeared and after that I ran "use mysql" and it selected that database. Now, I ran the command again "UPDATE mysql.user SET password=PASSWORD('MyNewPass') WHERE User='root';" This time I got the error message - ERROR 1504 (42S22) : Unknown column 'password' in the 'field list'.

I am stuck on this error at the moment. Why I am getting this error?

Options: ReplyQuote
Re: How do I recover/ change my phpmyadmin password on Wampserver.
Posted by: Otomatic (Moderator)
Date: October 09, 2016 10:39AM

Hi,

> ERROR 1504 (42S22) : Unknown column 'password' in the 'field list'.
Yhis is because for MySQL version since 5.7.0 the column name is changed.


- Resetting a forgotten root password
and/or
- Reassign root with all privileges

If you have set a password for the root user, but you have forgotten it, or you accidentally deleted all with root privileges, you can choose a new password and re-allocate privileges the following procedure in Windows:

The Windows session must be administrator and Wampserver started as administrator.

1. Stop the mysql service
wampmanager -> MySQL -> Service -> Stop Service

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

3. Find the [wampmysqld] or [wampmysqld64] section in the ini file
Add this line directly after the section [wampmysqld] or [wampmysqld64]
skip-grant-tables

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

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

6a. Now we are going to reset the password for the root user, of course this could be used to reset any users password.

enter the following 2 commands at the mysql> command prompt, each with a semi colon at the end of a line, and press ENTER after each line to issue the command to mysql.
--- For MySQL versions prior 5.7.0
UPDATE mysql.user SET Password=PASSWORD('MyNewPass') WHERE user='root';
FLUSH PRIVILEGES;
--- For MySQL versions after 5.7.0
UPDATE mysql.user SET authentication_string = PASSWORD('MyNewPass'), password_expired = 'N' WHERE User = 'root';
FLUSH PRIVILEGES;

6b. Reassign all privileges to root : enter the following 2 commands at the mysql> command prompt, each with a semi colon at the end of a line, and press ENTER after each line to issue the command to mysql. (Given the length of the first line, it is necessary to perform copy / paste).
UPDATE mysql.user SET Select_priv='Y', Insert_priv='Y', Update_priv='Y', Delete_priv='Y', Create_priv='Y', Drop_priv='Y', Reload_priv='Y', Shutdown_priv='Y', Process_priv='Y', File_priv='Y', Grant_priv='Y', References_priv='Y', Index_priv='Y', Alter_priv='Y', Show_db_priv='Y', Super_priv='Y', Create_tmp_table_priv='Y', Lock_tables_priv='Y', Execute_priv='Y', Repl_slave_priv='Y', Repl_client_priv='Y', Create_view_priv='Y', Show_view_priv='Y', Create_routine_priv='Y', Alter_routine_priv='Y', Create_user_priv='Y', Event_priv='Y', Trigger_priv='Y', Create_tablespace_priv='Y' WHERE User='root';

FLUSH PRIVILEGES;

Note that the update should report that it has updated more than one row, that because there are actually 3 user accounts with the userid of 'root' each with a different domain i.e. 127.0.0.1, localhost and ::1

7. Now enter 'quit' at the mysql command promt to exist mysql.

8. Stop the mysql service
wampmanager -> MySQL -> Service -> Stop Service

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

10. Find the [wampmysqld] or [wampmysqld64] section in the ini file
Remove the 'skip-grant-tables' parameter we added earlier.
DO NOT Leave this parameter in the ini file its a HUGH security hole.

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

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote
Re: How do I recover/ change my phpmyadmin password on Wampserver.
Posted by: Cmrec (157.48.182.---)
Date: April 29, 2021 05:27PM

How do I recover/ change my phpmyadmin password on Wampserver.

Options: ReplyQuote
Re: How do I recover/ change my phpmyadmin password on Wampserver.
Posted by: Otomatic (Moderator)
Date: April 29, 2021 06:35PM

Item 10 of Wampserver 3 - Some explanations

---------------------------------------------------------------
Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons

Options: ReplyQuote


Sorry, you can't reply to this topic. It has been closed.