Bug #108044 First login failed when installer generate a password contains ">".
Submitted: 1 Aug 2022 10:43 Modified: 1 Aug 2022 14:21
Reporter: Jim Yandex Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Installing Severity:S3 (Non-critical)
Version:8.0.30 OS:CentOS (7.9.2004)
Assigned to: CPU Architecture:x86

[1 Aug 2022 10:43] Jim Yandex
Description:
When I configure my new server, I made a clean installation of community-8.0 edition following the official guide.

➜  ~ grep 'temporary password' /var/log/mysqld.log
2022-08-01T10:12:58.378395Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: :glX>hj7sIVC
➜  ~ mysql -uroot -p
Enter password: 
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

I think it's weird, and I found the generated password contains a ">", so I removed the server, deleted /var/lib/mysql, and make a installation again.

And this time, I login successfully by the temporary password.

➜  ~ systemctl start mysqld
➜  ~ grep 'temporary password' /var/log/mysqld.log
2022-08-01T10:12:58.378395Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: :glX>hj7sIVC
2022-08-01T10:29:20.348586Z 6 [Note] [MY-010454] [Server] A temporary password is generated for root@localhost: ojX8-+QopU2D
➜  ~ 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.30

Copyright (c) 2000, 2022, 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> 

How to repeat:
I don't know how to reproduce because is caused by random passsword generation.

Suggested fix:
add  rules to prevent generating password contains ">"
[1 Aug 2022 13:35] MySQL Verification Team
Hi Mr. Yandex,

Thank you for your bug report.

We created the account with the same password and  restarted mysql with :

-uusername -p

and we typed in the exact password that you used.

It worked without problems.

Please do not use :

-p:glX>hj7sIVC

but only type it in .........

Anyway, you only have to do it once and then you can change password  .....
[1 Aug 2022 14:21] Jim Yandex
Hi, of course I didn't use -p:password, because I do know that using ">" in shell will cause output redirect to a specific file.
I just use -p and pressed enter to go into interactive authentication, manually typed the password char by char, I even didn't use copy and paste, and that also failed. 
I don't know whether it's a problem with interactive authentication, or the installer output a wrong password in log.

Yes, it's not a serious problem because it only affect first runs, won't cause any production damage, I also already made a clean installation again and the new password works, I just curious about why it happens.
[1 Aug 2022 14:22] MySQL Verification Team
Hi,

We truly do not know.

On our Linux, it worked like a charm .....