1.安装Windows的打包版本会提示你是否安装成服务 2.在Windows下用mysqld-nt.exe可以注册为服务,即用mysqld-nt --install mysql 这会设置为mysqld-nt.exe为mysql服务,相关信息在命令行模式下查询mysqld-nt --verbose --helpmysqld-nt.exe在mysql的安装目录下的bin目录中,安装成功后能在[管理工具-服务]中找到mysql这个服务。服务名可以自定义,有些套装组件一般不会选择mysql这个服务名,而会安装成mysql2(例如:xampp,会将mysql安装成mysql2、Apache安装成apache2服务)。以下是xampp安装mysql为Windows服务的批处理脚本:@=================================== @echo off 判断操作系统if "%OS%" == "Windows_NT" goto WinNT :Win9X @Win9x不能安装为服务 echo Don't be stupid! Win9x don't know Services echo Please use mysql_start.bat instead goto exit :WinNT @拷贝%windir%下的my.ini,做个备份 if exist %windir%\my.ini GOTO CopyINI if exist c:\my.cnf GOTO CopyCNF if not exist %windir%\my.ini GOTO MainNT if not exist c:\my.cnf GOTO MainNT :CopyINI echo Safe the %windir%\my.ini as %windir%\my.ini.old! copy %windir%\my.ini /-y %windir%\my.ini.old del %windir%\my.ini GOTO WinNT :CopyCNF @拷贝my.cnf文件,做备份 echo Safe the c:\my.cnf as c:\my.cnf.old! copy c:\my.cnf /-y c:\my.cnf.old del c:\my.cnf GOTO WinNT :MainNT @通过mysqld-nt的install参数安装服务,并指定mysql的配置文件 @安装完后启动mysql服务 echo Installing MySQL as an Service copy "%cd%\bin\my.cnf" /-y %windir%\my.ini bin\mysqld-nt --install mysql --defaults-file="%cd%\bin\my.cnf" echo Try to start the MySQL deamon as service ... net start MySQL :exit pause@=========================================================Good luck
搞定了, 照zhxmcm(乖张小书)的方法mysqld-nt --install安裝成服務,看到啟動類型為自動, 右鍵點擊它選啟動,啟動不了,出現1067錯誤,而且這時候發現連雙擊mysqld-nt.exe也啟動不了, mysqld-nt --remove刪除服務,雙擊mysqld-nt.exe又能啟動了, 上網找1067錯誤,我的mysql裝在d:\mysql,網上找到這個跟我的一樣: ================= you seemed have your mysql installed in windows. so this problem may becaused if you're not installing mysql in c:\mysql.you cansimply copy all files to c:\mysql orcreate a file call my.ini(store it in %windows%) OR my.cnf (store it in c:\) and the followingcontent should be in the file assume you have mysql ind:\mysql[mysqld] #set basedir to the installationpath basedir=d:/mysql datadir=d:/mysql/datanote that theforward slashes (/) are being used. good luck” ================= 跟據這個說的新建一個my.ini文件,加這些進去: [mysqld] #set basedir to the installationpath basedir=d:/mysql datadir=d:/mysql/data 然後放在系統winnt目錄裡,再重新mysqld-nt --install,然後就解決問題了。
任务管理器下的进程开机是没有mysql的,我点击mysqld-nt.exe启运后才会在进程里出现mysql
2.在Windows下用mysqld-nt.exe可以注册为服务,即用mysqld-nt --install mysql
这会设置为mysqld-nt.exe为mysql服务,相关信息在命令行模式下查询mysqld-nt --verbose --helpmysqld-nt.exe在mysql的安装目录下的bin目录中,安装成功后能在[管理工具-服务]中找到mysql这个服务。服务名可以自定义,有些套装组件一般不会选择mysql这个服务名,而会安装成mysql2(例如:xampp,会将mysql安装成mysql2、Apache安装成apache2服务)。以下是xampp安装mysql为Windows服务的批处理脚本:@===================================
@echo off 判断操作系统if "%OS%" == "Windows_NT" goto WinNT :Win9X
@Win9x不能安装为服务
echo Don't be stupid! Win9x don't know Services
echo Please use mysql_start.bat instead
goto exit :WinNT
@拷贝%windir%下的my.ini,做个备份
if exist %windir%\my.ini GOTO CopyINI
if exist c:\my.cnf GOTO CopyCNF
if not exist %windir%\my.ini GOTO MainNT
if not exist c:\my.cnf GOTO MainNT :CopyINI
echo Safe the %windir%\my.ini as %windir%\my.ini.old!
copy %windir%\my.ini /-y %windir%\my.ini.old
del %windir%\my.ini
GOTO WinNT :CopyCNF
@拷贝my.cnf文件,做备份
echo Safe the c:\my.cnf as c:\my.cnf.old!
copy c:\my.cnf /-y c:\my.cnf.old
del c:\my.cnf
GOTO WinNT :MainNT
@通过mysqld-nt的install参数安装服务,并指定mysql的配置文件
@安装完后启动mysql服务
echo Installing MySQL as an Service
copy "%cd%\bin\my.cnf" /-y %windir%\my.ini
bin\mysqld-nt --install mysql --defaults-file="%cd%\bin\my.cnf"
echo Try to start the MySQL deamon as service ...
net start MySQL :exit
pause@=========================================================Good luck
下面的我就不用多说了,选计算机启动时.
我在cmd中使用这个命令将他安装成服务,你试一试,安装之前先关掉服务器,两个路径名全都换成你的
==================
看要是我的mysql还没注册成服务,但这个不行,提示不能创建服务,进去看我的mysql里没有my.ini这个文件,有my-huge.ini,my-innodb-heavy-4G.ini,my-large.ini,my-medium.ini,my-small.ini这几个。xampp要下载这个软件还要安装,先用添加计划任务这个先
如果是压缩包.按楼上的方法将mysql安装成服务,my.ini在你的windows文件夹里面.
我的是压宿包,下载回来不用安装就直接用了
1.打开命令行窗口(CMD)
2.切换到mysql目录下,例如:d:\xampp\mysql\bin
3.输入mysqld-nt --install,回车
4.系统提示(Service successfully installed.) //可省略
5.打开[控制面板-管理工具-服务] //可省略
6.查看服务"MySql"的启动类型为自动即可 //可省略备注:
1.步骤3,mysqld-nt --install后可不加任何参数,默认配置。
2.用命令行mysqld-nt --remove,可删除任务
3.不要使用计划任务,因为计划任务必须配置时间。
4.前次提供xampp脚本,是期望兄弟能看懂配置文件,不想你误会了必须配置该文件
************************************************
BILLSJONE(BILL_JONE) ( ) 信誉:64 Blog 2007-3-7 0:26:57 得分: 0
http://blogger.org.cn/blog/uploadfile/20073703121635.GIF这是我设置成计划任务的捉图,不能跟着系统启动,不知道哪里设置错了?
*****************************************************************
我觉的应该是设置密码那边没有设,不过我不确定!只能提个意见!
将mysqld-nt.exe快捷方式拖入程序->开始就可以啦啊回复人:jzh2004() ( 一级(初级))
楼上正解昏死过去!
怎么可以象mssql那样设置开机跟着启动?“怎么可以象mssql那样设置开机跟着启动?”,兄弟SQL Server在系统里是以“服务”的方式运行的。
照zhxmcm(乖张小书)的方法mysqld-nt --install安裝成服務,看到啟動類型為自動,
右鍵點擊它選啟動,啟動不了,出現1067錯誤,而且這時候發現連雙擊mysqld-nt.exe也啟動不了,
mysqld-nt --remove刪除服務,雙擊mysqld-nt.exe又能啟動了,
上網找1067錯誤,我的mysql裝在d:\mysql,網上找到這個跟我的一樣:
=================
you seemed have your mysql installed in windows. so this problem may becaused if you're not installing mysql in c:\mysql.you cansimply copy all files to c:\mysql orcreate a file call my.ini(store it in %windows%) OR my.cnf (store it in c:\) and the followingcontent should be in the file
assume you have mysql ind:\mysql[mysqld]
#set basedir to the installationpath
basedir=d:/mysql
datadir=d:/mysql/datanote that theforward slashes (/) are being used. good luck”
=================
跟據這個說的新建一個my.ini文件,加這些進去:
[mysqld]
#set basedir to the installationpath
basedir=d:/mysql
datadir=d:/mysql/data
然後放在系統winnt目錄裡,再重新mysqld-nt --install,然後就解決問題了。