mysql不能配置
MySQL安裝中(Windows MSI install 版本)
配置ini文件并為MySQl創(chuàng)建Windows服務(wù)的時(shí)候出現(xiàn)問(wèn)題:Cannot create windows service for mysql5.error:0 和couldnot start the service MySQL 錯(cuò)誤,導(dǎo)致最終配置 Excute的時(shí)候無(wú)法成功; 安裝模式選擇Custom以后,安裝的目標(biāo)文件和數(shù)據(jù)文件的地址分別為: E:\Program Files\MySQL\MySQL Server ----------(*1) C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.1\data ----------(*2) 雖然會(huì)出現(xiàn)上述錯(cuò)誤,但是不成功的MySQL服務(wù)仍然會(huì)被添加到Windows服務(wù)組中,比較簡(jiǎn)單的刪除該服務(wù)的方式是: 運(yùn)行-->cmd-->sc delete MySQL(自己定義的服務(wù)的名稱) 另外在注冊(cè)表里有個(gè)相關(guān)項(xiàng)HKEY_LOCAL_MACHINE-->SYSTEM-->CurrentControlSet-->Services下有一個(gè)MySQL鍵值,刪除的同時(shí)可以一并刪除。 一種據(jù)說(shuō)很多人都解決的方案是: 運(yùn)行里輸入services.msc,進(jìn)入服務(wù)組,停止MySQL服務(wù),運(yùn)行 sc delete MySQL 卸載MySQL ,重新啟動(dòng),重新安裝,配置OK 不過(guò)對(duì)我一直無(wú)效: 在(*2)里找到錯(cuò)誤日志文件:C:\Documents and Settings\All Users\Application Data\MySQL\MySQL Server 5.1\data\Elwin.err 錯(cuò)誤信息的片段如下: --------------------------------------------------------------------------------------------------- InnoDB: The first specified data file E:\Data\ibdata1 did not exist: InnoDB: a new database to be created! 090501 19:20:08 InnoDB: Setting file E:\Data\ibdata1 size to 10 MB InnoDB: Database physically writes the file full: wait... InnoDB: Error: log file .\ib_logfile0 is of different size 0 48234496 bytes InnoDB: than specified in the .cnf file 0 17825792 bytes! 090501 19:20:09 [ERROR] Plugin 'InnoDB' init function returned error. 090501 19:20:09 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 090501 19:20:09 [ERROR] Unknown/unsupported table type: INNODB 090501 19:20:09 [ERROR] Aborting 090501 19:20:09 [Warning] Forcing shutdown of 1 plugins 090501 19:20:09 [Note] E:\Program Files\MySQL\MySQL Server\bin\mysqld: Shutdown complete -------------------------------------------------------------------------------------------------------------- CSDN社區(qū)的牛人提供的解決方案如下: 在配置 (my.ini)文件里面寫上 [mysqld] skip-innodb 重新啟動(dòng)就好了。 或者: 或者直接把ibdata 以及ib_logfile0、ib_logfile1刪掉再啟動(dòng)就好了。 ---------------------------------------------------------------------------------- 我直接將那三個(gè)ibdata以及ib_logfile0,ib_logfile1刪除再重新進(jìn)行配置成功。 ps:整整半天就這么耗在這上面了。 另外在Windows平臺(tái)下啟動(dòng)和關(guān)閉MySQL服務(wù) 對(duì)于noninstall安裝的 MySQL,可以在DOS窗口下通過(guò)命令行的方式啟動(dòng)和關(guān)閉MySQL服務(wù)。 1,啟動(dòng)服務(wù): cd E:\Program Files\MySQL\MySQL Server\bin E:\Program Files\MySQL\MySQL Server\bin>mysqld --console 運(yùn)行結(jié)果如下: 注意:在命令行啟動(dòng)MySQL 時(shí),如果不加"--console",啟動(dòng)關(guān)閉信息將不會(huì)在界面中顯示,而是記錄在安裝目錄下的data目錄里面,文件名字一般是hostname.err,可以通過(guò)此文件查看MySQL的控制臺(tái)信息; 2,關(guān)閉服務(wù): E:\Program Files\MySQL\MySQL Server\bin>mysqladmin -uroot shutdown |
二、另外我剛才還遇到一個(gè)問(wèn)題。問(wèn)題如下:
security settings could not be applied to the database because the connection has failed with the following error. Error Nr. 1045 Access denied for user 'root'@'localhost' (using password: NO)
解決方法是:原文地址http://hi.baidu.com/sunnychat/blog/item/b888b6c8ed282f137f3e6f91.html
全文如下:
我在Suse Linux 10.2下用自帶光盤用Yast2安裝Mysql 5.0, 裝好后在終端輸入mysql, mysql
成功啟動(dòng),退出,再輸入 mysqladmin -u root password XXXXX, 出現(xiàn)錯(cuò)誤: mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
如先輸入mysql,成功啟動(dòng)后輸入use mysql,出現(xiàn)如下錯(cuò)誤:Access denied for user ''@'localhost' to database 'mysql'
還有,輸mysql可以,輸mysql -u root就出錯(cuò)了:
Access denied for user 'root'@'localhost' (using password: NO).
The reason is:
是昨日更新ROOT密碼時(shí)出錯(cuò)
update user set password = '123456' where user ="root" //這樣寫是錯(cuò)的,密碼其實(shí)不是123456
應(yīng)該為update user set password = password ('123456') where user = "root"
具體操作步驟:
關(guān)閉mysql:
# service mysqld stop
然后:
# mysqld_safe --skip-grant-tables
啟動(dòng)mysql:
# service mysqld start
mysql -u root
mysql> use mysql
mysql> UPDATE user SET Password=PASSWORD('xxx') WHERE user='root';
mysql> flush privileges;
mysql>\q
That's it. I hope those above could do a little favor for you!
posted on 2009-07-03 17:06 lau 閱讀(1091) 評(píng)論(0) 編輯 收藏 所屬分類: MYSQL