12345678910111213141516171819202122232425 | @ECHO ON@echo 设置环境变量@SET sqlpath=%~dp0@setx /M PATH "%sqlpath%bin;%path%"@echo 初始化数据库配置文件@del %sqlpath%\my.ini@echo [mysqld]>>%sqlpath%\my.ini@echo port=3306>>%sqlpath%\my.ini@echo basedir=%sqlpath%>>%sqlpath%\my.ini@echo datadir=%sqlpath%\data>>%sqlpath%\my.ini@echo max_connections=200>>%sqlpath%\my.ini@echo max_connect_errors=10>>%sqlpath%\my.ini@echo character-set-server=utf8mb4>>%sqlpath%\my.ini@echo default-storage-engine=INNODB>>%sqlpath%\my.ini@echo default_authentication_plugin=mysql_native_password>>%sqlpath%\my.ini@echo [mysql]>>%sqlpath%\my.ini@echo default-character-set=utf8mb4>>%sqlpath%\my.ini@echo [client]>>%sqlpath%\my.ini@echo default-character-set=utf8mb4>>%sqlpath%\my.ini@echo port=3306>>%sqlpath%\my.ini@%sqlpath%\bin\mysqld.exe --initialize-insecure --lower-case-table-names=1 --user=mysql --console@echo 开始安装数据库@%sqlpath%\bin\mysqld.exe --install@net start mysql@pause |