kaio37k
kaio37k

Reputation: 21

Cannot reset root password - Windows 10

Windows force restarted on me yesterday right after setting up MySQL and popSQL, now, mySQL is telling me my password - that I know is right - is incorrect. I'm trying to reset the root password, but literally none of the guides have worked.

I've tried the official guide here, but I get a couple of errors, it does not reset the name.

The errors are:

C:\Program Files\MySQL\MySQL Server 8.0\bin>mysqld --init-file=C:\\mysql-init.txt

2019-02-19T16:44:49.460933Z 0 [System] [MY-010116] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe (mysqld 8.0.15) starting as process 8864

2019-02-19T16:44:49.464194Z 0 [Warning] [MY-010091] [Server] Can't create test file C:\Program Files\MySQL\MySQL Server 8.0\data\DESKTOP-2DUTV5J.lower-test

2019-02-19T16:44:49.464260Z 0 [Warning] [MY-010091] [Server] Can't create test file C:\Program Files\MySQL\MySQL Server 8.0\data\DESKTOP-2DUTV5J.lower-test

2019-02-19T16:44:49.464399Z 0 [ERROR] [MY-013276] [Server] Failed to set datadir to 'C:\Program Files\MySQL\MySQL Server 8.0\data\' (OS errno: 2 - No such file or directory)

2019-02-19T16:44:49.478891Z 0 [ERROR] [MY-010119] [Server] Aborting

2019-02-19T16:44:49.479009Z 0 [System] [MY-010910] [Server] C:\Program Files\MySQL\MySQL Server 8.0\bin\mysqld.exe: Shutdown complete (mysqld 8.0.15)  MySQL Community Server - GPL.

How can I fix this? I just want to reset my password.

BEFORE THE MOD MARKS THIS AS A DUPLICATE, UNLIKE THE LINKED THREADS, I'M NOT USING PHP, UNIX, XAMPP OR .BATs......... and half the links in that thread are dead. I've tried their solutions, they did not work. It's clear my issue is unique.

I've also included the 'name-installed' log file

Upvotes: 2

Views: 2393

Answers (3)

William Barela
William Barela

Reputation: 116

According to the MySQL 8 docs, if you used the wizard to install MySQL, you have to specify the .ini file like this:

C:\> mysqld
     --defaults-file="C:\\ProgramData\\MySQL\\MySQL Server 8.0\\my.ini"
     --init-file=C:\\mysql-init.txt

There was not a need to create the data folder (however, doing so did remove some of the errors, but not all).

Upvotes: 2

R0KKET
R0KKET

Reputation: 85

I had an issue with logging in so I tried to reset the password and got this same error. From what I understood this happens because MySQL server daemon is looking for the my.ini in C:\Program Files\MySQL\MySQL Server 8.0\data\, which in my case, was not there. my.ini is originally in the Data directory in C:\ProgramData\MySQL\MySQL Server 8.0.

Try copying the whole Data directory from C:\ProgramData\MySQL\MySQL Server 8.0 into C:\Program Files\MySQL\MySQL Server 8.0\

Turned out the logging in issue I had was also due to the missing Data directory. I don't know how the Data directory went missing in the first place or whether copying the same Data directory from C:\ProgramData\MySQL\MySQL Server 8.0 would result in some kind of a clash in configuration settings later on, but to this date it all seems to be working fine. If someone knows why this happened or is there any other proper solutions for this matter, kindly let me know too

Upvotes: 0

Abdelwahed
Abdelwahed

Reputation: 17

All you have to do is manually create data folder on C:\Program Files\MySQL\MySQL Server 8.0\ path.

Upvotes: 0

Related Questions