Mysql安裝
- 版本: 8.0
- 添加源
yum localinstall https://repo.mysql.com//mysql80-community-release-el7-1.noarch.rpm
- 安裝
yum install mysql-community-server
-
啟動(dòng)mysql
systemctl start mysqld
-
設(shè)置mysql開(kāi)機(jī)自啟
systemctl enable mysqld
-
查看初始密碼
grep 'temporary password' /var/log/mysqld.log
-
進(jìn)入mysql
mysql -u root -p
-
修改密碼
ALTER USER 'root'@'localhost' IDENTIFIED BY 'Huang|12345'
-
查看版本
select version(); +-----------+ | version() | +-----------+ | 8.0.16 | +-----------+ 1 row in set (0.00 sec)
-
查看端口
show global variables like 'port'; +---------------+-------+ | Variable_name | Value | +---------------+-------+ | port | 3306 | +---------------+-------+ 1 row in set (0.04 sec)