安装 MySQL 作为 airflow 的数据库 - 密码问题

安装 MySQL 作为 airflow 的数据库 - 密码问题

我在 WSL2 上有 Ubuntu 20.04.4 LTS(GNU/Linux 5.10.102.1-microsoft-standard-WSL2 x86_64)。

我正在按照本指南安装 Mysql,并且已经到达第 4 步,其中我选择了 MEDIUM 并提示输入新密码。

https://phoenixnap.com/kb/install-mysql-ubuntu-20-04

sudo mysql_secure_installation

Connecting to MySQL using a blank password.
The 'validate_password' component is installed on the server.
The subsequent steps will run with the existing configuration
of the component.
Please set the password for root here.

New password:

Re-enter new password:

Estimated strength of the password: 100
Do you wish to continue with the password provided?(Press y|Y for Yes, any other key for No) : y
 ... Failed! Error: SET PASSWORD has no significance for user 'root'@'localhost' as the authentication method used doesn't store authentication data in the MySQL server. Please consider using ALTER USER instead if you want to change authentication parameters.

然后它就一直要求我输入新密码并出现这个错误。

稍后,当我尝试使用这些命令来设置 MySQL 数据库时:

CREATE DATABASE airflow_db CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'airflow_user' IDENTIFIED BY 'airflow_pass';
GRANT ALL PRIVILEGES ON airflow_db.* TO 'airflow_user';

https://airflow.apache.org/docs/apache-airflow/stable/howto/set-up-database.html

我被困在

mysql> CREATE USER 'airflow_user' IDENTIFIED BY 'airflow_pass';
ERROR 1819 (HY000): Your password does not satisfy the current policy requirements

我想知道我是否需要做类似的事情?

新安装的 MySQL 没有 root 密码,无法设置

CREATE USER 'admin'@'localhost' IDENTIFIED WITH mysql_native_password BY 'superSecretPassword!123';
GRANT ALL ON *.* TO 'admin'@'localhost' WITH GRANT OPTION;

我该如何解决这个问题?

相关内容