[odb-users] Utilizing MySQL Login Paths

Boris Kolpackov boris at codesynthesis.com
Tue Jun 3 07:12:32 EDT 2025


Tyler Lytle <tlytle123 at gmail.com> writes:

> I am trying to utilize MySQL login path configurations. These are located
> in the home directory of the current user in a hidden file named
> .mylogin.cnf. It contains an encrypted password and a default
> username/hostname. From the command-line, if I simply execute "mysql" and
> it will automatically log me into MySQL without specifying a
> username/password on the command-line and without a password prompt.
> 
> Can I utilize this in any way with the MySQL ODB database class?

ODB uses the libmysqlclient C library and all the database class
arguments are passed essentially as-is to its function that creates
the connection.

So to answer your question we will need to understand whether this
.mylogin.cnf file is something specific to the mysql client program
or if libmysqlclient also supports using it as a source of login
information.

If the answer is "yes", then we would need to understand how exactly
this is triggered. Maybe via a client_flags?

If the answer if "no", then the only option is for you to parse this
file yourself, extract all the information and pass it to the ODB
database constructor.



More information about the odb-users mailing list