I am implementing a C++ server with a mariadb backend. I have to access my database and I do so using the mariadbpp (its c++ connector). Though I can use mysql_config_editor and store the passwords in an (encrypted) .cnf file, mariadbpp's API needs a password. This is how I am using it:
mariadb::account_ref acc = mariadb::account::create("localhost", "order", "<password>", "Orders");
The database is configured to only be accessible from localhost. Is putting the password in .cpp source file okay from security perspective?