rpm -qa | grep mysql
有的話先刪除乾淨mysql
wget https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm
yum localinstall mysql80-community-release-el7-1.noarch.rpm
yum clean all yum makecache
groupadd mysql
若提示已經存在 groupadd: group 'mysql' already exists 解決: groupdel mysql 瞭解詳情spring
若提示沒法刪除 groupdel: cannot remove the primary group of user 'mysql' sql
sudo vipw
sudo vipw -s
若vim 保存提示 readonly option is set (add!to override) 你有權限修改文件嗎? 若是是root權限,能夠 :wq! 瞭解詳情數據庫
以後就能夠正常執行以下命令了vim
groupdel mysql groupadd mysql useradd -g mysql mysql
yum install mysql-community-server
systemctl start mysqld
cat /var/log/mysqld.log | grep password
mysql -u root -p
ALTER USER 'root'@'localhost' IDENTIFIED BY 'yourpassword';
密碼必定要大小寫字母+數字+符號,如:Aa-123456789
不然報錯: ERROR 1819 (HY000): Your password does not satisfy the current policy requirements 瞭解詳情segmentfault
update user set host = "%" where user = "root"; GRANT ALL PRIVILEGES ON *.* TO 'root'@'%'WITH GRANT OPTION;
FLUSH PRIVILEGES;
本地用sqlyog鏈接遇到這個(可能版本過低) 瞭解詳情ide
下載Navicat能夠正常鏈接網站
本文參考ui
我的網站.net