mac下配置mysql總結

來源:互聯網
上載者:User

標籤:

mac下使用mysql時出現了ERROR 1045 (28000): Access denied for user ‘root‘@‘localhost‘ (using password: NO)錯誤

root使用者無法登陸,按網上的方法實驗了下,總是達不到結果

大致方法都是進入安全模式啟動,然後進行操作,

解決方案:

以安全模式啟動 MySQ: 
/usr/bin/safe_mysqld --skip-grant-tables & 

>use mysql 
>update user set password=password("new_pass") where user="root"; 
>flush privileges; 

注意要使用password=password("new_pass"),不能直接使用password=‘new_pass‘,否則在新版本的mysql中還會拒絕串連。

好多文章是沒有最後一句的,所以我是一直按後邊的方式走的,所以退出安全模式總是解決不了問題,password函數很關鍵,設定完成再去查看發現密碼是加過密的,所以你用明文寫,系統按加密讀,結果永遠不對

mac下配置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.