赞
踩
安装环境为:在 win11系统 -> virtualbox 虚拟机 -> centos7.9 系统 -> MySQL8.0
测试时间为:2023 年 05 月
$ uname -m # 输出 x86_64
$ cat /etc/redhat-release # 输出 CentOS Linux release 7.9.2009 (Core)
对应文件为:Red Hat Enterprise Linux 7 / Oracle Linux 7 (Architecture Independent)
点击:浏览器 ->下载 -> 右键复制文件下载链接,安装 yum 资源:
下载链接为:https://repo.mysql.com//mysql80-community-release-el7-7.noarch.rpm
$ rpm -ivh https://repo.mysql.com//mysql80-community-release-el7-7.noarch.rpm
$ yum info mysql-community-server # 8.0.33
$ yum -y install mysql-community-server
安装完成!
$ systemctl start mysqld.service
$ systemctl status mysqld.service
$ grep "password" /var/log/mysqld.log
2023-05-10T01:41:41.632792Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: _ih4M9ogiXt%
# 其中最后的 _ih4M9ogiXt% 就是密码
$ mysql -u root -p # 初始密码为之前获取的 _ih4M9ogiXt%
# 密码设置必须要大小写字母数字和特殊符号
$ ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';
$ mysql -u root -p # 使用修改过后的密码
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.33 MySQL Community Server - GPL
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
配置完成!
所使用的数据库管理软件为 Datagrip,亲测十分好用。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。