Drush and database credentials from external sources
As you can see, drush is run from command line interface, so it uses cli/php.ini and not regular one. If you feel like keeping password and username in ini file, you need to make sure there are synchronized between WWW and CLI php.ini files.