Re: MYSQL Root 登入問題

看板FreeBSD作者時間19年前 (2006/05/03 20:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串4/10 (看更多)
※ 引述《forever60713.bbs@ptt.cc (橫渡交大沙漠中...)》之銘言: > 他給我 ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using > password: NO) 為啥直接打 mysql -u root 會出現 Access denied (using password: NO)? 這是因為你已有設過 mysql 內的 root 密碼, 所以要連的話,通常應該是 mysql -u root -p 或 mysql -u root -p -h 你MySQL Server的IP 打完後會出來提示問你密碼,這時候再打密碼 > PS: 假設說其實我帳號已經設定好 ROOT 給他密碼 > 登入時候是不是用 > mysql -u root password '我的密碼' ? 通常我的作法是會先改掉 root 帳號,另外建立一組 root 等級的帳號,並設密碼 以降低不必要的風險(並不是這樣就完全不會有風險)。 而且也不會直接打 mysql -u root password '我的密碼' 因為 shell 通常都有 history 記憶功能,這樣太危險了 下次人家翻你帳號家目錄的 .history 或是切換為你帳號, 然後輕鬆按個上下鍵就知道你密碼打什麼了.. 所以 mysql -u root password '我的密碼' 是相當『勇敢之舉』。 :p -- ※ Origin: SayYA 資訊站 <bbs.sayya.org> ◆ From: 61-63-0-host123.kbtelecom.net.tw
文章代碼(AID): #14M9k300 (FreeBSD)
文章代碼(AID): #14M9k300 (FreeBSD)