Mysql_config_editor

Upgraded to 8 last week and it seems mysql_config_editor is throwing errors since then. Xtrabackup isn’t running as it’s trying to read the user credentials from there but failing. I tried creating a new file which seems to work but then can’t be read or updated.

Any ideas?

[root@db ~]# mysql_config_editor --verbose set --login-path=andrew --host=localhost --port=3307 --user=andrew --password --skip-warn
File exists.
File has the required permission.
Opening the file.
Reading the login key.
file read operation failed
operation failed.
[root@db ~]# rm .mylogin.cnf
rm: remove regular file ‘.mylogin.cnf’? y
[root@db ~]# mysql_config_editor --verbose set --login-path=andrew --host=localhost --port=3307 --user=andrew --password --skip-warn
File exists.
File has the required permission.
Opening the file.
Reading the login key.
Login key read successfully.
Executing set command.
Enter password:
Successfully decrypted the login file.
Key successfully written to the file.
Successfully written encrypted data to the login file.
[root@db ~]# mysql --login-path=andrew
ERROR 1045 (28000): Access denied for user ‘root’@‘localhost’ (using password: NO)
[root@db ~]# mysql_config_editor --verbose set --login-path=andrew --host=localhost --port=3307 --user=andrew --password --skip-warn
File exists.
File has the required permission.
Opening the file.
Reading the login key.
file read operation failed
operation failed.
[root@db ~] mysql_config_editor --version
mysql_config_editor Ver 8.0.33-25 for Linux on x86_64 (Percona Server (GPL), Release 25, Revision 9468fd1d)

Hi @Andrew2,
I just tested this and I’m not able to reproduce. I can create the config and login just fine.

mysql [localhost:8034] {msandbox} ((none)) > CREATE USER foo@localhost IDENTIFIED BY 'foo1234';
Query OK, 0 rows affected (0.02 sec)

$ ~/dbdeployer/opt/mysql/ps8.0.34/bin/mysql_config_editor --verbose set --login-path=foo --host=localhost --user=foo --password --socket=/tmp/mysql_sandbox8035.sock
File does not exist.
Creating login file.
Login file created.
Opening the file.
Generating a new key.
Key successfully written to the file.
Executing set command.
Enter password:
Key successfully written to the file.
Successfully written encrypted data to the login file.

$ ~/dbdeployer/opt/mysql/ps8.0.34/bin/mysql --login-path=foo
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.0.34-26 Percona Server (GPL), Release 26, Revision 0fe62c85

$ ~/dbdeployer/opt/mysql/8.0.34/bin/mysql_config_editor print --all
[foo]
user = "foo"
password = *****
host = "localhost"
socket = "/tmp/mysql_sandbox8034.sock"

The issue went away but I’m now seeing it on a different server.
Both are mysql on EC2 so I wonder if it’s an AWS file system issue rather than a MySQL or config editor issue

I’ve found the issue.

A shell script that was using the .mylogin.cnf was still running but, for some reason, wasn’t showing up when I did ‘lsof’ for the .mylogin.cnf file

Killing the script allowed the config editor to work as normal and write/update the file.