發(fā)現(xiàn)問題
今天在MAC上安裝完MYSQL后,MYSQL默認(rèn)給分配了一個默認(rèn)密碼,但當(dāng)自己在終端上使用默認(rèn)密碼登錄的時候,總會提示一個授權(quán)失敗的錯誤:Access denied for user ‘root’@’localhost’ (using passwor)如圖:文章來源:http://www.zghlxwxcb.cn/news/detail-669158.html
解決問題
首先,進(jìn)入到/usr/local/mysql/support-file,然后按以下步驟操作:文章來源地址http://www.zghlxwxcb.cn/news/detail-669158.html
# cd /usr/local/mysql/support-file && ./mysql.server stop
# sudo /usr/local/mysql/bin/mysqld_safe --skip-grant-tables &
mysql > UPDATE mysql.user SET authentication_string=PASSWORD('root123*') WHERE User='root';
mysql > FLUSH PRIVILEGES;
mysql > \q
# cd /usr/local/mysql/support-file && ./mysql.server start
# /usr/local/mysql/bin/mysql -u root -p
passwd: 輸入密碼
到了這里,關(guān)于MAC解決MySQL登錄ERROR 1045 (28000): Access denied for user root@localhost (using passwor)問題的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!