Enter the administrator cmd interface
Enter the bin directory of mysql installation
cd C:\Program Files\MySQL\MySQL Server 5.5\bin
Install the service first
mysqld.exe -install
Then run mysql again
mysql -uroot -p密码
If an error is reported
ERROR 1045 (28000): Access denied for user ‘ODBC’@‘localhost’ (using password: YES)
Then maybe you forgot your password
Need to skip verification to enter
open administrator cmd
Enter the bin directory of mysql installation
cd C:\Program Files\MySQL\MySQL Server 5.5\bin
run
//跳过校验
mysqld --skip-grant-tables
//使用mysql数据库
USE mysql;
//更改密码
UPDATE USER SET PASSWORD=PASSWORD('你的密码') WHERE USER='root';
//刷写权限
flush privileges;
//退出
quit