Windows Server 2003開機自動啟動MySQL服務設定方法

來源:互聯網
上載者:User

標籤:

Windows Server 2003開機自動啟動MySQL服務設定方法發布時間:2014-12-19 更新時間:2014-12-24 來源:網路 eaglezhong 
關鍵詞: 2003 exe 開機 nbsp; 設定方法

 

&http://www.aliyun.com/zixun/aggregation/37954.html">nbsp;   每次開機我都要去點擊mysqld-nt.exe執行檔案才啟動mysql,雖然將建立了mysqld-nt.exe捷徑到案頭,但還是想它能自動啟動,怎麼可以象mssql那樣設定開機跟著啟動?

    下面為筆者總結的一些經驗與大家分享:

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.不要使用計劃任務,因為計劃任務必須配置時間。

如果通過以上方面無法在服務中啟動Mysql,請進行以下的設定:

照以上的方法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   or

create   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/data

note   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,然後就解決問題了。

 

筆者測試通過該方法即解決Windows Server 2003下Mysql自動啟動的服務。

 

Windows Server 2003開機自動啟動MySQL服務設定方法

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.