簡述在centos7環境下安裝mysql的過程,主要就是修改預設密碼並開啟遠端許可權這一步,這樣方便遠端連線進行讀寫。以下是詳細過程:
wget
rpm -ivh mysql57-community-release-el7-9.noarch.rpm
yum install mysql-server
systemctl start mysqld #啟動mysql
修改mysql密碼,首先以root登入,提示輸入密碼直接跳過即可
[root@vm_0_14_centos home]# mysql -uroot -p
enter password:
welcome to the mysql monitor. commands end with ; or \g.
your mysql connection id is 3
server version: 5.7.28
mysql> set password=password("你的密碼");
query ok, 0 rows affected, 1 warning (0.00 sec)
# 執行flush privileges後才生效
mysql> flush privileges;
query ok, 0 rows affected (0.01 sec)
mysql>
# 模板:
grant all privileges on 庫名.表名 to '使用者名稱'@'ip位址' identified by '密碼' with grant option;
flush privileges;
# *.*表示所有資料庫和表 'root'@'%'表示不限制登入使用者的ip
Centos7離線安裝mysql5
2.將部署包存放到 opt 資料夾下 3.解壓並安裝 cd opt mkdir mysql tar xvf opt mysql 5.7.30 1.el7.x86 64.rpm bundle.tar c opt mysql cd opt mysql rpm uvh rpm nodeps force1....
Centos7使用yum安裝Mysql5 7
centos7的yum源中預設是沒有mysql,因為現在已經用mariadb代替mysql了。安裝mysql rpm包 rpm ivh mysql57 community release el7 11.noarch.rpm 安裝mysql yum install mysql community se...
Centos 7 使用yum安裝mysql 5 7
wget 2 安裝mysql yum y install mysql57 community release el7 10.noarch.rpm yum y install mysql community server 3 啟動mysql systemctl start mysqld.service...