這兩天安裝了AppServ2.5.9之后,發現MySQL無法啟動。
在事件查看器應用程序日記里的錯誤信息:“Can't find messagefile 'G: erver\AppServ\MySQL\share\english\errmsg.sys'”。
查看MySQL配置文件my.ini在[mysqld]段中有:
#Path to installation directory. All paths are usually resolved relative to this.
basedir="G:\server\AppServ/MySQL"
#Path to the database root
datadir="G:\server\AppServ/MySQL/data/"
根據以往的經驗,將應用程序從Linux移植到Windows了,文件路徑一般都必須修改,比如:Linux下的“/tmp”與“C:\\WINDOWS\temp”。之所以會出現“G:\server”解析成“G:erver”,我想可能是“\s”被格式化了,所以需要改成“G:\\server”,即:
#Path to installation directory. All paths are usually resolved relative to this.
basedir="G:\\server\AppServ/MySQL"
#Path to the database root
datadir="G:\\server\AppServ/MySQL/data/"
修改完了,啟動MySQL,一切正常。