1045 access denied for user 'root'@'localhost' using password yes

來源:互聯網
上載者:User

標籤:style   http   color   使用   os   strong   檔案   資料   

這兩個在安裝mysql資料庫碰到一些頭疼的很。

 

   "1045 access denied for user ‘root‘@‘localhost‘ using password yes"

在命令列中進入:C:\Program Files\MySQL\MySQL Server 5.5\bin

 

 

C:\Program Files\MySQL\MySQL Server 5.1\bin>mysqld  --defaults-file="C:\Program Files\MySQL\MySQL Server 5.5\bin\my.ini" --console --skip-grant-tables

090515 22:06:09 [ERROR] The update log is no longer supported by MySQL in versio
n 5.0 and above. It is replaced by the binary log. Now starting MySQL with --log
-bin=‘‘ instead.
090515 22:06:09  InnoDB: Started; log sequence number 0 324221
090515 22:06:09 [Note] mysqld: ready for connections.
Version: ‘5.1.33-community-log‘  socket: ‘‘  port: 3306  MySQL Community Server
(GPL)

看到這個結果就說明MySQL已經起來了。
再開一個DOS視窗,同樣切到mysql bin目錄下,

輸入

mysql> UPDATE user SET Password=PASSWORD(’newpassword’) where USER=’root’; 
mysql> FLUSH PRIVILEGES; 
mysql> quit 

然後
C:\Program Files\MySQL\MySQL Server 5.5\bin>mysqladmin shutdown
之後正常重啟MySQL服務就行了。

 

 

配置好最後點擊 Execute 按鈕了,但是進行不到 Start service 這一步。

檢查了下 MySQL 系統服務已添加,但是無法啟動,手工也不行。這時候用事件檢視器可以看到程式事件裡有幾個來自於 MySQL 的錯誤: 

Plugin ‘InnoDB‘ registration as a STORAGE ENGINE failed. 
Unknown/unsupported table type: INNODB 

原來是因為這兩版本的 MySQL 預設使用了支援事物的 INNODB 引擎,開啟 my.ini 檔案,在 MySQL 的安裝資料夾, 如 C:\Program Files\MySQL\MySQL Server 5.5\bin 中,看到: 

default-storage-engine=INNODB 

解決辦法是把該設定改為 

default-storage-engine=MYISAM 

 

如果還是不行則找到:skip-innodb 取消登出,後在服務中手動啟動。

 

 

註:主要參考http://bbs.csdn.net/topics/310006640

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.