ubuntu20.4
mysql8.0
sudo apt update
sudo apt upgrade
sudo apt istall mysql
service mysql status //康康mysql
sudo cat /etc/mysql/debian.cnf //這可能是原始配置資訊
mysql -u debian-sys-maint -p //mysql
1)、use mysql; #連線到mysql資料庫
2)、update mysql.user set authentication_string=password(‘123456’) where user=’root’ and Host =’localhost’; #修改密碼123456是密碼
3)、update user set plugin=”mysql_native_password”;
4)、flush privileges;
5)、quit;
參考地址!(www.cnblogs.com/williamjie/p/11126...)
報錯
ALTER USER ‘root‘@’localhost’ IDENTIFIED BY ‘123456’;
用這個,上面報錯可能是版本問題
然後就是成功後我用navicat連線成功後報錯:
1449 - the user specified as a definer(‘mysql.infoschema‘@’localhost’)does n
參考連線(https://blog.csdn.net/weixin_44159171/article/details/109716461)
本作品採用《CC 協議》,轉載必須註明作者和本文連結