MySQL 5.7.x 安装
2. MySQL Repo
[mysql57-community]name=MySQL 5.7 Community Serverbaseurl=http://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/enabled=1gpgcheck=0
3. CentOS上安装
--------------------------------------------------------------------------------------------# 安装MySQL# yum -y install mysql-community-server.x86_64--------------------------------------------------------------------------------------------# 启动MySQL# systemctl statr mysqld.service--------------------------------------------------------------------------------------------# 获取临时生成的密码# grep password /var/log/mysqld.log****** 1 [Note] A temporary password is generated for root@localhost: -n5:oh(tQwnI
4. 登录MySQL变更root密码
# mysql -u root -pEnter password: '临时密码'Welcome to the MySQL monitor. Commands end with ; or \g.Your MySQL connection id is 5Server version: 5.7.35 MySQL Community Server (GPL)Copyright (c) 2000, 2021, Oracle and/or its affiliates.Oracle is a registered trademark of Oracle Corporation and/or itsaffiliates. Other names may be trademarks of their respectiveowners.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY '新密码';Query OK, 0 rows affected (0.00 sec)mysql> quit;Bye