Home >Backend Development >PHP Tutorial >The solution to Access denied for user root@localhost using password:YES in mysql is implemented by myself
Change the ROOT password under DOS: Of course, you can also change the password after installing PHPMYADMIN later through PHPMYADMIN
Format: mysqladmin -u username -p old password password new password
Example: Add a password to root 123
First enter the CMD command line, path to check the bin location of mysql; then go to the bin directory under the MYSQL directory, and then type the following command
mysqladmin -u root password 123
Note: Because At the beginning, root did not have a password, so the -p old password item can be omitted.
D:phpMySQLbin>mysqladmin-uroot password ideacmblog After pressing Enter, the ROOT password is set to 123
The above introduces the solution to Access denied for user root@localhost using password:YES in mysql, which I have implemented in practice, including the relevant aspects. I hope it will be helpful to friends who are interested in PHP tutorials.