当前位置:Gxlcms > 数据库问题 > MySQL绿色安装

MySQL绿色安装

时间:2021-07-01 10:21:17 帮助过:13人阅读

off echo 停止服务 net stop mysql echo 删除服务 sc delete mysql echo 安装mysql... cd /d %~dp0\bin mysqld.exe -install ping 127.1 -n 1 >nul ping 127.1 -n 1 >nul echo 初始化mysql... mysqld.exe --initialize EXIT
@echo off
echo 停止服务
taskkill /f /im mysqld.exe
taskkill /f /im mysql.exe
net stop mysql >nul
echo 删除服务
sc delete mysql
echo 卸载mysql
cd /d %~dp0\bin
ping 127.1 -n 1 >nul
mysqld.exe -remove
rd /s /q %~dp0\data
::
@echo off
@title mysql密码重置为%pwd%
echo 1.停止mysql服务
set pwd=root
taskkill /f /im mysqld.exe
taskkill /f /im mysql.exe
net stop mysql >nul 
echo 2.mysqld 以 skip 权限 表 运行
cd /d %~dp0\bin
start mysqld.exe -nt --skip-grant-tables
ping 127.1 -n 1 >nul
echo use mysql;>C:\tmp.txt
echo update MySQL.user set authentication_string=password("%pwd%") where user=‘root‘;>>C:\tmp.txt
echo flush privileges; >>C:\tmp.txt
echo exit >>C:\tmp.txt
echo 3.mysql以root无密码登录 4.修改密码
echo "密码 重新设置为%pwd%了 "
mysql <C:\tmp.txt
taskkill /f /im mysqld.exe
taskkill /f /im mysql.exe
net stop mysql >nul 
net start mysql
del C:\tmp.txt /F
ping 127.1 -n 1 >nul
echo set password = PASSWORD("%pwd%");>C:\tmp.sql
echo exit >>C:\tmp.sql
echo "输入密码:%pwd%"
mysql.exe --connect-expired-password -u root -p"%pwd%"< C:\tmp.sql
ping 127.1 -n 1 >nul
del C:\tmp.sql /F
EXIT

 

MySQL绿色安装

标签:auth   mysqld   upd   mysql   password   let   exe   pass   bsp   

人气教程排行