|To make life easier, create a desktop icon for a DOS window that opens in the mysql |
C:\Program Files\MySQL\MySQL Server 5.7\binWhen you have that icon working, use it, then issue the command
net stop mysqlwhich will do what it says if MySQL is running as a network service. (If it is not, reboot the machine without any autoexec command that would start the server, then open a DOS window as above.) Now run
mysqld --skip-grant-tableswhich starts the server without usernames & passwords. Now open a 2nd instance of your DOS window and issue this cmd:
mysqlto start the MySQL client, and in it issue
use mysql; select host,user,password from user;Inspect the list to see if there is a user named 'root'. If there is, its host is likely 'localhost', its password is likely blank, and if you have not edited the 'root' user row, 'root' has all possible privileges. Those are the privileges you want, but 'root' should have a password, so give her one, before 5.7.6 ...
UPDATE user SET password=PASSWORD('yourdesiredpassword') WHERE user='root';... in 5.7 since 5.7.6 ...
UPDATE user SET authentication_string=PASSWORD('yourdesiredpassword') WHERE user='root';and in 8.0, where the
ALTER USER 'root' IDENTIFIED BY 'yourdesiredpassword';Then ...
FLUSH PRIVILEGES; EXIT;... and you should be able login from any host you've allowed for root.
If you have not installed MySQL as a service, do it now with
mysqld --installIssue these DOS cmds:
mysqladmin shutdown net start mysqland you should be ready to roll.
Last updated 26 Oct 2020