Forgotten or No Password - Locked Out of Account
Posted by: Jaa (---.bb.sky.com)
Date: September 25, 2017 07:23PM

I have just used phpMyAdmin on my local WAMP SERVER on WINDOWS 10 for the first time in about 6 months. I am using localhost:8080. I thought I had no password, however when it asks me to log in I put:

username: root
password: [I leave this blank]

I cannot log in.

I do not think I created a new password 6 months ago, but there is a small possibility I did and have now forgotten about it.

So now I am locked out of my phpMyAdmin.

I have tried the solution here by RiggsFolly:

[stackoverflow.com]

But no luck.

I do the following:

Stop the mysql service

wampmanager -> MySQL -> Service -> Stop Service

Edit the my.ini file

wampmanager -> MySQL -> my.ini

Find the wampmysqld64 section in the ini file Add this line directly after that section heading

skip-grant-tables

Restart the mysql service.

wampmanager -> MySQL -> Service -> Start/Resume Service

Open the MySQL console

wampmanager -> MySQL -> MySQL Console

It asks for the password, but I just tap enter and it seems to skip that. I then get the MySQL> prompt.

I have version 5.7.9 so I enter the following:

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

Sometimes it gives a warning, but I do not know what.

I should then do the following two commands now, but I get a problem:

ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER;
FLUSH PRIVILEGES;

It says (after the ALTER USER bit):

ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement

If I do the obvious thing and stop the service as above and then alter the .ini file again to remove that line. I then restart and retype the ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER; command. This time it complains saying I should have just done a password change to make this command. (It basically thinks I have not just done the password change as I have had to shut down the system, alter the ini file and then restart in between the commands.)

So I am stuck at this point getting nowhere fast.

If the ALTER USER 'root'@'localhost' PASSWORD EXPIRE NEVER; and FLUSH PRIVILEGES; had worked, I would have then have had to continue with the following:

At the console mysql> prompt I would then need to type:

quit;

Then stop the mysql service:

wampmanager -> MySQL -> Service -> Stop Service

Edit the my.ini file

wampmanager -> MySQL -> my.ini

Find the wampmysqld64 section in the ini file Remove the skip-grant-tables parameter we added earlier.

Restart the mysql service.

wampmanager -> MySQL -> Service -> Start/Resume Service

However, as I am stuck at those two commands with no workaround I remain locked out of phpMyAdmin



Edited 2 time(s). Last edit at 09/25/2017 07:25PM by Jaa.

Options: ReplyQuote
Re: Forgotten or No Password - Locked Out of Account
Posted by: Otomatic (Moderator)
Date: September 25, 2017 08:21PM

Hi,

The process is here [forum.wampserver.com] and works well.

------------------------------------------------------------------------------------------------------------
(W7 Pro 64 bit)-Wampserver 3.1.0 32 bit - Apache 2.4.27 - PHP 7.1.10/7.0.24/5.6.31 - MySQL 5.7.19 - MariaDB 10.2.8
Wampserver 3.1.0 64 bit - Apache 2.4.27 - PHP 7.1.10/7.0.24/5.6.31 - MySQL 5.7.19 - MariaDB 10.2.8
PhPMyAdmin 4.7.4 - MysqlDumper 1.24.5

Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: Forgotten or No Password - Locked Out of Account
Posted by: Jaa (---.bb.sky.com)
Date: September 25, 2017 10:30PM

I have tried this.

It allows me to do everything this time (I set the password to nothing, ie no string)

However, at the end of the process I try to login with 'root' and '' and it says 'Cannot log in to the MySQL server'44'

Even when I try a password, eg 'abc' it still does not allow me to login at the end saying the same error.

When I enter the line 'UPDATE mysql.user SET authentication_string' it gives me a warning, but I do not know what it is.



Edited 1 time(s). Last edit at 09/25/2017 10:39PM by Jaa.

Options: ReplyQuote
Re: Forgotten or No Password - Locked Out of Account
Posted by: Otomatic (Moderator)
Date: September 25, 2017 10:38PM

Hi,

Use right password, not a blank one.

------------------------------------------------------------------------------------------------------------
(W7 Pro 64 bit)-Wampserver 3.1.0 32 bit - Apache 2.4.27 - PHP 7.1.10/7.0.24/5.6.31 - MySQL 5.7.19 - MariaDB 10.2.8
Wampserver 3.1.0 64 bit - Apache 2.4.27 - PHP 7.1.10/7.0.24/5.6.31 - MySQL 5.7.19 - MariaDB 10.2.8
PhPMyAdmin 4.7.4 - MysqlDumper 1.24.5

Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: Forgotten or No Password - Locked Out of Account
Posted by: Jaa (---.bb.sky.com)
Date: September 25, 2017 10:40PM

I edited my reply as you were making your new suggestion - it does not work even when I put in a password 'abc'.

When I enter the line 'UPDATE mysql.user SET authentication_string' it gives me a warning, but I do not know what it is.



Edited 2 time(s). Last edit at 09/25/2017 11:20PM by Jaa.

Options: ReplyQuote
Re: Forgotten or No Password - Locked Out of Account
Posted by: Otomatic (Moderator)
Date: September 26, 2017 09:42AM

Hi,

See MySQL documentation :
[dev.mysql.com]
and
[dev.mysql.com]

The procedure that I have given you is that of MySQL, so if it does not work, you have to see directly with MySQL.

------------------------------------------------------------------------------------------------------------
(W7 Pro 64 bit)-Wampserver 3.1.0 32 bit - Apache 2.4.27 - PHP 7.1.10/7.0.24/5.6.31 - MySQL 5.7.19 - MariaDB 10.2.8
Wampserver 3.1.0 64 bit - Apache 2.4.27 - PHP 7.1.10/7.0.24/5.6.31 - MySQL 5.7.19 - MariaDB 10.2.8
PhPMyAdmin 4.7.4 - MysqlDumper 1.24.5

Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote
Re: Forgotten or No Password - Locked Out of Account
Posted by: Jaa (---.bb.sky.com)
Date: September 26, 2017 11:37AM

Otomatic Wrote:
-------------------------------------------------------
> you have to see directly with MySQL.

What does this mean? I understand that my problem is occurring because my setup is not doing what it should. But how do I find out why? Who can I ask?

Options: ReplyQuote
Re: Forgotten or No Password - Locked Out of Account
Posted by: Otomatic (Moderator)
Date: September 26, 2017 04:20PM

Hi,

It simply means what I have already written.
The procedures and links that have been given to you are from the MySQL documentation.
These procedures have already been successfully applied by several Wampserver users. If it does not work for you, we can not know why. Only MySQL support could give you a solution.

------------------------------------------------------------------------------------------------------------
(W7 Pro 64 bit)-Wampserver 3.1.0 32 bit - Apache 2.4.27 - PHP 7.1.10/7.0.24/5.6.31 - MySQL 5.7.19 - MariaDB 10.2.8
Wampserver 3.1.0 64 bit - Apache 2.4.27 - PHP 7.1.10/7.0.24/5.6.31 - MySQL 5.7.19 - MariaDB 10.2.8
PhPMyAdmin 4.7.4 - MysqlDumper 1.24.5

Documentation Apache - Documentation PHP - Documentation MySQL - Wampserver install files & addons
« Ce n'est pas parce qu'ils sont nombreux à avoir tort, qu'ils ont forcément raison. Coluche »
« It's not because they are many to be wrong, they are necessarily right. Coluche »

Options: ReplyQuote


Sorry, only registered users may post in this forum.