Introduce how to change the default password of mysql. After installing MySQL on the Windows platform, the system has generated the permission table and account by default. You do not need to execute the mysql_install_db script to generate the account and corresponding permission table like on the Unix platform. However, if you do not install MySQL in MSI format, you will need to manually add a new password to the root account after installation, because root does not have password protection enabled by default. If you do not reassign the password to the root account, many non-root accounts will The connection to the machine will not be successful. The specific steps to update your password are as follows:
c:>mysql -u root
mysql>set password for 'root'@'localhost'=password('newpasswd' );
mysql>set password for 'root'@'%'=password('newpasswd' ); //This item is optional
Through the above settings, the root password will become newpasswd, thus completing the setting of the root password for the root user.