Centos安裝mysql
阿新 • • 發佈:2018-12-17
1、解除安裝mysql
rpm -qa |grep -i mysql
yum remove mysql-community*
yum remove mysql80-community-release-el7-1.noarch
2、去mysql官網下載noarch.rpm檔案,上傳到指定目錄
執行安裝命令
sudo rpm -ivh mysql80-community-release-el7-1.noarch.rpm
sudo yum install mysql-server
vi /etc/my.cnf 新增:skip-grant-tables
3、設定密碼:
service mysqld strat
mysql -u root
use mysql;
update user set authentication_string="root!2018LC" where user="root";
flush privileges;
3、navicat遠端連線
檢視3306埠是否開啟
firewall-cmd --query-port=3306/tcp
開放3306 埠
firewall-cmd --add-port=3306/tcp