yum安裝mysql (新版本CentOS自帶mariadb而不是mysql,所以要先卸載了,否則會衝突) 查找mariadb rpm -qa | grep mariadb 卸載mariadb rpm -e --nodeps mariadb-libs-5.5.52-1.el7.x86_64 安裝my ...
yum安裝mysql
(新版本CentOS自帶mariadb而不是mysql,所以要先卸載了,否則會衝突)
查找mariadb
rpm -qa | grep mariadb
卸載mariadb
rpm -e --nodeps mariadb-libs-5.5.52-1.el7.x86_64
安裝mysql依賴
yum install vim libaio net-tools
下載mysql源
wget http://repo.mysql.com/yum/mysql-5.7-community/el/7/i386/mysql57-community-release-el7-10.noarch.rpm
安裝mysql源
sudo rpm -ivh mysql57-community-release-el7-10.noarch.rpm
開始安裝mysql
sudo yum install mysql-server
過程全部輸入y
安裝完先啟動服務systemctl start mysql.service
(停止服務systemctl stop mysql.service)
修改root密碼步驟
進入
cd /var/log/
查找初始密碼
grep 'temporary password' /var/log/mysqld.log
登陸mysql
mysql -u root -p
修改root密碼
update user set authentication_string=password('123abc') where user='root';