Deepin安裝mySQL

運行命令:

sudo apt-get install -y mysql-server mysql-client
sudo mysql -uroot -p

進入之後:

update mysql.user set plugin="mysql_native_password" where user="root";
grant all on *.* to root@"localhost";

這裏我暫時把密碼設置爲123456

update mysql.user set authentication_string=password('123456') where user='root'and Host = 'localhost';
flush privileges;

然後登錄的時候

sudo mysql -uroot -p

輸入你之前設置的密碼就OK啦
在這裏插入圖片描述

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章