Ubuntu 20.04 从零开始安装MySQL 8.0并重置root密码
Posted Rudon滨海渔村
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Ubuntu 20.04 从零开始安装MySQL 8.0并重置root密码相关的知识,希望对你有一定的参考价值。
步骤
- sudo apt-get autoremove --purge mysql*
- sudo apt-get update
- sudo apt-get install mysql-server
- service mysql status
running... - sudo cat /etc/mysql/debian.cnf
# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host = localhost
user = debian-sys-maint
password = tZmePZ77d177DYWR
socket = /var/run/mysqld/mysqld.sock
- mysql -u debian-sys-maint -p
输入上面的密码 tZmePZ77d177DYWR - mysql> SHOW VARIABLES LIKE 'validate_password%';
+--------------------------------------+--------+
| Variable_name | Value |
+--------------------------------------+--------+
| validate_password.check_user_name | ON |
| validate_password.dictionary_file | |
| validate_password.length | 8 |
| validate_password.mixed_case_count | 1 |
| validate_password.number_count | 1 |
| validate_password.policy | MEDIUM |
| validate_password.special_char_count | 1 |
+--------------------------------------+--------+
7 rows in set (0.01 sec)
关于 mysql 密码策略相关参数;
1)、validate_password_length 固定密码的总长度;
2)、validate_password_dictionary_file 指定密码验证的文件路径;
3)、validate_password_mixed_case_count 整个密码中至少要包含大/小写字母的总个数;
4)、validate_password_number_count 整个密码中至少要包含阿拉伯数字的个数;
5)、validate_password_policy 指定密码的强度验证等级,默认为 MEDIUM;
关于 validate_password_policy 的取值:
0/LOW:只验证长度;
1/MEDIUM:验证长度、数字、大小写、特殊字符;
2/STRONG:验证长度、数字、大小写、特殊字符、字典文件; - mysql> alter user 'root'@'localhost' identified with mysql_native_password by 'Fuc*USA8';
密码自己定义,默认需要:大小写字母+数字+符号+长度8位 - mysql> flush privileges;
- mysql> exit
- service mysql restart
- service mysql status
- mysql -uroot -p
输入你设置的新密码即可 - 搞定
鸣谢
How To Install MySQL on Ubuntu 20.04 | DigitalOceanhttps://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-20-04Your password does not satisfy the current policy requirements_一尘在心的博客-CSDN博客关于这个问题是在 《 基于MySQL Yum存储库在Linux-7.2上安装MySQL-5.7.21数据库服务(实战篇) 》 时遇到的问题,这是 mysql 初始化时,使用临时密码,修改自定义密码时,由于自定义密码比较简单,就出现了不符合密码策略的问题。密码策略问题异常信息:ERROR 1819 (HY000): Your password does not satisfy the cur...https://blog.csdn.net/zhanaolu4821/article/details/93622812生成随机密码 - 密码生成器生成随机密码https://suijimimashengcheng.bmcx.com/?r=@
完整经历
rudon@vmu:~$ mysql -uroot -p
Command 'mysql' not found, but can be installed with:
sudo apt install mysql-client-core-8.0 # version 8.0.27-0ubuntu0.20.04.1, or
sudo apt install mariadb-client-core-10.3 # version 1:10.3.31-0ubuntu0.20.04.1
rudon@vmu:~$ service mysql status
Unit mysql.service could not be found.
rudon@vmu:~$
rudon@vmu:~$ sudo apt-get update
[sudo] rudon 的密码:
命中:1 http://packages.microsoft.com/repos/code stable InRelease
命中:2 https://mirrors.ustc.edu.cn/ubuntu focal InRelease
命中:3 https://mirrors.ustc.edu.cn/ubuntu focal-updates InRelease
命中:4 https://mirrors.ustc.edu.cn/ubuntu focal-backports InRelease
命中:5 https://dl.google.com/linux/chrome/deb stable InRelease
命中:6 https://mirrors.ustc.edu.cn/ubuntu focal-security InRelease
命中:7 https://mirrors.ustc.edu.cn/ubuntu focal-proposed InRelease
忽略:8 https://deepin-wine.i-m.dev InRelease
命中:9 https://deepin-wine.i-m.dev Release
忽略:10 https://deepin-wine.i-m.dev Release.gpg
正在读取软件包列表... 完成
rudon@vmu:~$ sudo apt-get install mysql-server
正在读取软件包列表... 完成
正在分析软件包的依赖关系树... 完成
正在读取状态信息... 完成
将会同时安装下列软件:
libaio1 libcgi-pm-perl libevent-core-2.1-7 libevent-pthreads-2.1-7 libhtml-template-perl libmecab2 mecab-ipadic mecab-ipadic-utf8 mecab-utils
mysql-client-8.0 mysql-client-core-8.0 mysql-common mysql-server-8.0 mysql-server-core-8.0
建议安装:
libipc-sharedcache-perl mailx tinyca
推荐安装:
libcgi-fast-perl
下列【新】软件包将被安装:
libaio1 libcgi-pm-perl libevent-core-2.1-7 libevent-pthreads-2.1-7 libhtml-template-perl libmecab2 mecab-ipadic mecab-ipadic-utf8 mecab-utils
mysql-client-8.0 mysql-client-core-8.0 mysql-common mysql-server mysql-server-8.0 mysql-server-core-8.0
升级了 0 个软件包,新安装了 15 个软件包,要卸载 0 个软件包,有 7 个软件包未被升级。
需要下载 31.5 MB 的归档。
解压缩后会消耗 262 MB 的额外空间。
您希望继续执行吗? [Y/n] y
获取:1 https://mirrors.ustc.edu.cn/ubuntu focal/main amd64 mysql-common all 5.8+1.0.5ubuntu2 [7,496 B]
获取:2 https://mirrors.ustc.edu.cn/ubuntu focal-updates/main amd64 mysql-client-core-8.0 amd64 8.0.27-0ubuntu0.20.04.1 [4,423 kB]
获取:3 https://mirrors.ustc.edu.cn/ubuntu focal-updates/main amd64 mysql-client-8.0 amd64 8.0.27-0ubuntu0.20.04.1 [22.0 kB]
获取:4 https://mirrors.ustc.edu.cn/ubuntu focal/main amd64 libaio1 amd64 0.3.112-5 [7,184 B]
获取:5 https://mirrors.ustc.edu.cn/ubuntu focal/main amd64 libevent-core-2.1-7 amd64 2.1.11-stable-1 [89.1 kB]
获取:6 https://mirrors.ustc.edu.cn/ubuntu focal/main amd64 libevent-pthreads-2.1-7 amd64 2.1.11-stable-1 [7,372 B]
获取:7 https://mirrors.ustc.edu.cn/ubuntu focal/main amd64 libmecab2 amd64 0.996-10build1 [233 kB]
获取:8 https://mirrors.ustc.edu.cn/ubuntu focal-updates/main amd64 mysql-server-core-8.0 amd64 8.0.27-0ubuntu0.20.04.1 [18.4 MB]
获取:9 https://mirrors.ustc.edu.cn/ubuntu focal-updates/main amd64 mysql-server-8.0 amd64 8.0.27-0ubuntu0.20.04.1 [1,313 kB]
获取:10 https://mirrors.ustc.edu.cn/ubuntu focal/main amd64 libcgi-pm-perl all 4.46-1 [186 kB]
获取:11 https://mirrors.ustc.edu.cn/ubuntu focal/main amd64 libhtml-template-perl all 2.97-1 [59.0 kB]
获取:12 https://mirrors.ustc.edu.cn/ubuntu focal/main amd64 mecab-utils amd64 0.996-10build1 [4,912 B]
获取:13 https://mirrors.ustc.edu.cn/ubuntu focal/main amd64 mecab-ipadic all 2.7.0-20070801+main-2.1 [6,714 kB]
获取:14 https://mirrors.ustc.edu.cn/ubuntu focal/main amd64 mecab-ipadic-utf8 all 2.7.0-20070801+main-2.1 [4,380 B]
获取:15 https://mirrors.ustc.edu.cn/ubuntu focal-updates/main amd64 mysql-server all 8.0.27-0ubuntu0.20.04.1 [9,548 B]
已下载 31.5 MB,耗时 24秒 (1,314 kB/s)
正在预设定软件包 ...
正在选中未选择的软件包 mysql-common。
(正在读取数据库 ... 系统当前共安装有 232601 个文件和目录。)
准备解压 .../0-mysql-common_5.8+1.0.5ubuntu2_all.deb ...
正在解压 mysql-common (5.8+1.0.5ubuntu2) ...
正在选中未选择的软件包 mysql-client-core-8.0。
准备解压 .../1-mysql-client-core-8.0_8.0.27-0ubuntu0.20.04.1_amd64.deb ...
正在解压 mysql-client-core-8.0 (8.0.27-0ubuntu0.20.04.1) ...
正在选中未选择的软件包 mysql-client-8.0。
准备解压 .../2-mysql-client-8.0_8.0.27-0ubuntu0.20.04.1_amd64.deb ...
正在解压 mysql-client-8.0 (8.0.27-0ubuntu0.20.04.1) ...
正在选中未选择的软件包 libaio1:amd64。
准备解压 .../3-libaio1_0.3.112-5_amd64.deb ...
正在解压 libaio1:amd64 (0.3.112-5) ...
正在选中未选择的软件包 libevent-core-2.1-7:amd64。
准备解压 .../4-libevent-core-2.1-7_2.1.11-stable-1_amd64.deb ...
正在解压 libevent-core-2.1-7:amd64 (2.1.11-stable-1) ...
正在选中未选择的软件包 libevent-pthreads-2.1-7:amd64。
准备解压 .../5-libevent-pthreads-2.1-7_2.1.11-stable-1_amd64.deb ...
正在解压 libevent-pthreads-2.1-7:amd64 (2.1.11-stable-1) ...
正在选中未选择的软件包 libmecab2:amd64。
准备解压 .../6-libmecab2_0.996-10build1_amd64.deb ...
正在解压 libmecab2:amd64 (0.996-10build1) ...
正在选中未选择的软件包 mysql-server-core-8.0。
准备解压 .../7-mysql-server-core-8.0_8.0.27-0ubuntu0.20.04.1_amd64.deb ...
正在解压 mysql-server-core-8.0 (8.0.27-0ubuntu0.20.04.1) ...
正在设置 mysql-common (5.8+1.0.5ubuntu2) ...
update-alternatives: 使用 /etc/mysql/my.cnf.fallback 来在自动模式中提供 /etc/mysql/my.cnf (my.cnf)
正在选中未选择的软件包 mysql-server-8.0。
(正在读取数据库 ... 系统当前共安装有 232826 个文件和目录。)
准备解压 .../0-mysql-server-8.0_8.0.27-0ubuntu0.20.04.1_amd64.deb ...
正在解压 mysql-server-8.0 (8.0.27-0ubuntu0.20.04.1) ...
正在选中未选择的软件包 libcgi-pm-perl。
准备解压 .../1-libcgi-pm-perl_4.46-1_all.deb ...
正在解压 libcgi-pm-perl (4.46-1) ...
正在选中未选择的软件包 libhtml-template-perl。
准备解压 .../2-libhtml-template-perl_2.97-1_all.deb ...
正在解压 libhtml-template-perl (2.97-1) ...
正在选中未选择的软件包 mecab-utils。
准备解压 .../3-mecab-utils_0.996-10build1_amd64.deb ...
正在解压 mecab-utils (0.996-10build1) ...
正在选中未选择的软件包 mecab-ipadic。
准备解压 .../4-mecab-ipadic_2.7.0-20070801+main-2.1_all.deb ...
正在解压 mecab-ipadic (2.7.0-20070801+main-2.1) ...
正在选中未选择的软件包 mecab-ipadic-utf8。
准备解压 .../5-mecab-ipadic-utf8_2.7.0-20070801+main-2.1_all.deb ...
正在解压 mecab-ipadic-utf8 (2.7.0-20070801+main-2.1) ...
正在选中未选择的软件包 mysql-server。
准备解压 .../6-mysql-server_8.0.27-0ubuntu0.20.04.1_all.deb ...
正在解压 mysql-server (8.0.27-0ubuntu0.20.04.1) ...
正在设置 libmecab2:amd64 (0.996-10build1) ...
正在设置 mysql-client-core-8.0 (8.0.27-0ubuntu0.20.04.1) ...
正在设置 libcgi-pm-perl (4.46-1) ...
正在设置 libhtml-template-perl (2.97-1) ...
正在设置 mecab-utils (0.996-10build1) ...
正在设置 libevent-core-2.1-7:amd64 (2.1.11-stable-1) ...
正在设置 mysql-client-8.0 (8.0.27-0ubuntu0.20.04.1) ...
正在设置 libaio1:amd64 (0.3.112-5) ...
正在设置 libevent-pthreads-2.1-7:amd64 (2.1.11-stable-1) ...
正在设置 mecab-ipadic (2.7.0-20070801+main-2.1) ...
Compiling IPA dictionary for Mecab. This takes long time...
reading /usr/share/mecab/dic/ipadic/unk.def ... 40
emitting double-array: 100% |###########################################|
/usr/share/mecab/dic/ipadic/model.def is not found. skipped.
reading /usr/share/mecab/dic/ipadic/Noun.proper.csv ... 27328
reading /usr/share/mecab/dic/ipadic/Noun.nai.csv ... 42
reading /usr/share/mecab/dic/ipadic/Adj.csv ... 27210
reading /usr/share/mecab/dic/ipadic/Noun.others.csv ... 151
reading /usr/share/mecab/dic/ipadic/Suffix.csv ... 1393
reading /usr/share/mecab/dic/ipadic/Noun.place.csv ... 72999
reading /usr/share/mecab/dic/ipadic/Adnominal.csv ... 135
reading /usr/share/mecab/dic/ipadic/Prefix.csv ... 221
reading /usr/share/mecab/dic/ipadic/Noun.number.csv ... 42
reading /usr/share/mecab/dic/ipadic/Auxil.csv ... 199
reading /usr/share/mecab/dic/ipadic/Adverb.csv ... 3032
reading /usr/share/mecab/dic/ipadic/Postp-col.csv ... 91
reading /usr/share/mecab/dic/ipadic/Filler.csv ... 19
reading /usr/share/mecab/dic/ipadic/Interjection.csv ... 252
reading /usr/share/mecab/dic/ipadic/Postp.csv ... 146
reading /usr/share/mecab/dic/ipadic/Others.csv ... 2
reading /usr/share/mecab/dic/ipadic/Noun.adverbal.csv ... 795
reading /usr/share/mecab/dic/ipadic/Noun.org.csv ... 16668
reading /usr/share/mecab/dic/ipadic/Noun.adjv.csv ... 3328
reading /usr/share/mecab/dic/ipadic/Symbol.csv ... 208
reading /usr/share/mecab/dic/ipadic/Noun.verbal.csv ... 12146
reading /usr/share/mecab/dic/ipadic/Noun.demonst.csv ... 120
reading /usr/share/mecab/dic/ipadic/Noun.name.csv ... 34202
reading /usr/share/mecab/dic/ipadic/Conjunction.csv ... 171
reading /usr/share/mecab/dic/ipadic/Verb.csv ... 130750
reading /usr/share/mecab/dic/ipadic/Noun.csv ... 60477
emitting double-array: 100% |###########################################|
reading /usr/share/mecab/dic/ipadic/matrix.def ... 1316x1316
emitting matrix : 100% |###########################################|
done!
update-alternatives: 使用 /var/lib/mecab/dic/ipadic 来在自动模式中提供 /var/lib/mecab/dic/debian (mecab-dictionary)
正在设置 mysql-server-core-8.0 (8.0.27-0ubuntu0.20.04.1) ...
正在设置 mecab-ipadic-utf8 (2.7.0-20070801+main-2.1) ...
Compiling IPA dictionary for Mecab. This takes long time...
reading /usr/share/mecab/dic/ipadic/unk.def ... 40
emitting double-array: 100% |###########################################|
/usr/share/mecab/dic/ipadic/model.def is not found. skipped.
reading /usr/share/mecab/dic/ipadic/Noun.proper.csv ... 27328
reading /usr/share/mecab/dic/ipadic/Noun.nai.csv ... 42
reading /usr/share/mecab/dic/ipadic/Adj.csv ... 27210
reading /usr/share/mecab/dic/ipadic/Noun.others.csv ... 151
reading /usr/share/mecab/dic/ipadic/Suffix.csv ... 1393
reading /usr/share/mecab/dic/ipadic/Noun.place.csv ... 72999
reading /usr/share/mecab/dic/ipadic/Adnominal.csv ... 135
reading /usr/share/mecab/dic/ipadic/Prefix.csv ... 221
reading /usr/share/mecab/dic/ipadic/Noun.number.csv ... 42
reading /usr/share/mecab/dic/ipadic/Auxil.csv ... 199
reading /usr/share/mecab/dic/ipadic/Adverb.csv ... 3032
reading /usr/share/mecab/dic/ipadic/Postp-col.csv ... 91
reading /usr/share/mecab/dic/ipadic/Filler.csv ... 19
reading /usr/share/mecab/dic/ipadic/Interjection.csv ... 252
reading /usr/share/mecab/dic/ipadic/Postp.csv ... 146
reading /usr/share/mecab/dic/ipadic/Others.csv ... 2
reading /usr/share/mecab/dic/ipadic/Noun.adverbal.csv ... 795
reading /usr/share/mecab/dic/ipadic/Noun.org.csv ... 16668
reading /usr/share/mecab/dic/ipadic/Noun.adjv.csv ... 3328
reading /usr/share/mecab/dic/ipadic/Symbol.csv ... 208
reading /usr/share/mecab/dic/ipadic/Noun.verbal.csv ... 12146
reading /usr/share/mecab/dic/ipadic/Noun.demonst.csv ... 120
reading /usr/share/mecab/dic/ipadic/Noun.name.csv ... 34202
reading /usr/share/mecab/dic/ipadic/Conjunction.csv ... 171
reading /usr/share/mecab/dic/ipadic/Verb.csv ... 130750
reading /usr/share/mecab/dic/ipadic/Noun.csv ... 60477
emitting double-array: 100% |###########################################|
reading /usr/share/mecab/dic/ipadic/matrix.def ... 1316x1316
emitting matrix : 100% |###########################################|
done!
update-alternatives: 使用 /var/lib/mecab/dic/ipadic-utf8 来在自动模式中提供 /var/lib/mecab/dic/debian (mecab-dictionary)
正在设置 mysql-server-8.0 (8.0.27-0ubuntu0.20.04.1) ...
update-alternatives: 使用 /etc/mysql/mysql.cnf 来在自动模式中提供 /etc/mysql/my.cnf (my.cnf)
Renaming removed key_buffer and myisam-recover options (if present)
mysqld will log errors to /var/log/mysql/error.log
mysqld is running as pid 8734
Created symlink /etc/systemd/system/multi-user.target.wants/mysql.service → /lib/systemd/system/mysql.service.
正在设置 mysql-server (8.0.27-0ubuntu0.20.04.1) ...
正在处理用于 man-db (2.9.4-2) 的触发器 ...
正在处理用于 libc-bin (2.33-0ubuntu5) 的触发器 ...
rudon@vmu:~$
rudon@vmu:~$ service mysql status
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2021-11-03 10:05:01 CST; 22s ago
Process: 8856 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 8864 (mysqld)
Status: "Server is operational"
Tasks: 38 (limit: 19088)
Memory: 358.1M
CGroup: /system.slice/mysql.service
└─8864 /usr/sbin/mysqld
11月 03 10:05:01 vmu systemd[1]: Starting MySQL Community Server...
11月 03 10:05:01 vmu systemd[1]: Started MySQL Community Server.
rudon@vmu:~$
rudon@vmu:~$ mysql -uroot -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
rudon@vmu:~$
rudon@vmu:~$ sudo mysql_secure_installation
Securing the MySQL server deployment.
Enter password for user root:
Error: Access denied for user 'root'@'localhost' (using password: YES)
rudon@vmu:~$ echo 'What is the password????'
What is the password????
rudon@vmu:~$
rudon@vmu:~$ ll /etc/mysql/debian.cnf
-rw------- 1 root root 317 11月 3 10:04 /etc/mysql/debian.cnf
rudon@vmu:~$
rudon@vmu:~$ cat /etc/mysql/debian.cnf
cat: /etc/mysql/debian.cnf: 权限不够
rudon@vmu:~$ sudo cat /etc/mysql/debian.cnf
# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host = localhost
user = debian-sys-maint
password = tZmePZ77d177DYWR
socket = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host = localhost
user = debian-sys-maint
password = tZmePZ77d177DYWR
socket = /var/run/mysqld/mysqld.sock
rudon@vmu:~$
rudon@vmu:~$ mysql -u debian-sys-maint -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \\g.
Your MySQL connection id is 11
Server version: 8.0.27-0ubuntu0.20.04.1 (Ubuntu)
Copyright (c) 2000, 2021, 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.
mysql> alter user 'root'@'localhost' identified with mysql_native_password by '123456';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql>
mysql> alter user 'root'@'localhost' identified with mysql_native_password by 'tZmePZ77d177DYWR';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql>
mysql> alter user 'root'@'localhost' identified with mysql_native_password by 'http://baidu.rudon.cn';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql>
mysql> SHOW VARIABLES LIKE 'validate_password%';
+--------------------------------------+--------+
| Variable_name | Value |
+--------------------------------------+--------+
| validate_password.check_user_name | ON |
| validate_password.dictionary_file | |
| validate_password.length | 8 |
| validate_password.mixed_case_count | 1 |
| validate_password.number_count | 1 |
| validate_password.policy | MEDIUM |
| validate_password.special_char_count | 1 |
+--------------------------------------+--------+
7 rows in set (0.01 sec)
mysql> alter user 'root'@'localhost' identified with mysql_native_password by 'Jzmt3Mcq';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql>
mysql> alter user 'root'@'localhost' identified with mysql_native_password by 'JB*mysql';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements
mysql>
mysql> alter user 'root'@'localhost' identified with mysql_native_password by 'Fuc*USA8';
Query OK, 0 rows affected (0.01 sec)
mysql>
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
mysql> exit
Bye
rudon@vmu:~$ service mysql restart
rudon@vmu:~$ mysql -uroot -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \\g.
Your MySQL connection id is 8
Server version: 8.0.27-0ubuntu0.20.04.1 (Ubuntu)
Copyright (c) 2000, 2021, 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.
mysql> exit
Bye
rudon@vmu:~$ mysql -v
ERROR 1045 (28000): Access denied for user 'rudon'@'localhost' (using password: NO)
rudon@vmu:~$
rudon@vmu:~$
rudon@vmu:~$
rudon@vmu:~$
rudon@vmu:~$
rudon@vmu:~$
rudon@vmu:~$
rudon@vmu:~$
rudon@vmu:~$
rudon@vmu:~$
rudon@vmu:~$
rudon@vmu:~$
rudon@vmu:~$ service mysql status
● mysql.service - MySQL Community Server
Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor preset: enabled)
Active: active (running) since Wed 2021-11-03 10:36:36 CST; 3min 44s ago
Process: 10824 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre (code=exited, status=0/SUCCESS)
Main PID: 10832 (mysqld)
Status: "Server is operational"
Tasks: 38 (limit: 19088)
Memory: 358.1M
CGroup: /system.slice/mysql.service
└─10832 /usr/sbin/mysqld
11月 03 10:36:35 vmu systemd[1]: Starting MySQL Community Server...
11月 03 10:36:36 vmu systemd[1]: Started MySQL Community Server.
rudon@vmu:~$
以上是关于Ubuntu 20.04 从零开始安装MySQL 8.0并重置root密码的主要内容,如果未能解决你的问题,请参考以下文章