ubuntu下 mysql安裝之後沒法登錄的的解決方法((ERROR 1698 (28000): Access denied for user 'root'@'local...

 


1. 刪除mysql

 

 

sudo apt-get autoremove --purge mysql-server-5.0mysql

 

sudo apt-get remove mysql-serversql

sudo apt-get autoremove mysql-serverspa

sudo apt-get remove mysql-common code

 

 

2. 清理殘留數據
dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P

 

 

 


3. 安裝 mysql

 

 

sudo apt-get install mysql-server
sudo apt-get install mysql-client
 
4 解決普通用戶沒法登陸的問題:
sudo mysql -u root -p
select user, plugin from mysql.user;
update mysql.user set authentication_string=PASSWORD('newPwd'), plugin='mysql_native_password' where user='root';
flush privileges;
exit
從新進入
相關文章
相關標籤/搜索