Windows root user in a new installation of MySQL does not have a password, use the command line by typing directly mysql -uroot -p
enter to enter the mysql command-line interface. But we want to add a password for the root user how to do it?
- After the search has found use in the MySQL command line
set password for root@localhost = password("密码")
To establish methods for the root password, but after I test error, useless.
- Then I used another way: If your MySQL bin directory has been placed in an environment variable, you can type the console command line
mysqladmin -uroot -p password 密码
to set up the root password, type set up after the successmysql -uroot -p
will prompt you to type a password, enter your previous new set up the root password, enter the MySQL command line interface to start learning it!