@ECHO Off
:begin
:: Command line parameters.
set cur_path=%~dp0
set root_password_toset=123456
set base_dir=C:\Program Files\MySQL\MySQL Server 5.7
set data_dir=C:\ProgramData\MySQL\MySQL Server 5.7\Data
set my_dir=C:\ProgramData\MySQL\MySQL Server 5.7
set bin_dir=%base_dir%\bin
set server_name=MySQL57
net stop %server_name%
copy /y "%my_dir%\my.ini" "%my_dir%\my-1.ini"
echo [mysqld]>"%my_dir%\my.ini"
echo basedir=%base_dir%>>"%my_dir%\my.ini"
echo datadir=%data_dir%>>"%my_dir%\my.ini"
echo sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES >>"%my_dir%\my.ini"
echo character-set-server=utf8 >>"%my_dir%\my.ini"
echo plugin-load=validate_password.dll >>"%my_dir%\my.ini"
echo validate_password=FORCE_PLUS_PERMANENT >>"%my_dir%\my.ini"
echo validate_password_policy
bat下强制修改mysql5.7的root密码
最新推荐文章于 2023-05-18 20:15:44 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)