- net stop mysql #停止mysql服务
- mysqld --console --skip-grant-tables --shared-memory #启动无需密码登录模式
- mysql -uroot -p #重起一个窗口,无密码登录直接回车
- update mysql.user set authentication_string=password('root') where user='root' and Host = 'localhost';
- net start mysql #启动mysql服务
注:创建cmd ls 命令
在C:/windows目录下新建“ls.bat”文件,文件内容为:
@echo off
dir