Home > Software engineering >  MySQL on Windows - Access denied for user 'root'@'localhost' after fresh install
MySQL on Windows - Access denied for user 'root'@'localhost' after fresh install

Time:08-06

I've installed the latest MySQL on Windows 10 Pro. I included the wizard steps to set up initial values and chose to set it up as a dev machine. I left everything to the default values. After installing and restarting the machine, there's no way to connect to the database it seems.

I get the MySQL Error 1045: Access denied for user 'root'@'localhost' (using password: YES) error both in MySQL Workbench as well as the MySQL Shell.

I've tried to set skip-grant-tables in my.ini as that comes up in a lot of answers on here. When I set that and try to start the MySQL80 Service, it shuts itself down within seconds again.

I've also tried to start with mysqld.exe --skip-grant-tables as per this answer but that gave me the error that it couldn't find C:\Program Files\MySQL\MySQL Server 8.0\data. This folder indeed didn't exist, after making this folder myself and running mysqld.exe --skip-grant-tables again, 3 files were added to this folder but I'm immediately thrown back to my CMD shell and no mysqld.exe process is running.

To reiterate, this is a Windows 10 machine, answers about sudo mysql or /etc/my.conf are N/A unfortunately.

Workbench, MySQL Shell and CMD Prompt were all running as Administrator in the above steps.

CodePudding user response:

Did you try with "-p" and password "password"?

CodePudding user response:

Reinstalled MySQL with legacy authentication and the weakest password it'll accept and now it works... ¯\_(ツ)_/¯

  • Related