If your working on your localhost via phpMyAdmin simply click privileges from the main window when it loads and add a new user with all or only privileges you want it to have.
On a production server depending on the control panel your host uses you would do the same only via the MySQL management area.
I know how to add users and passwords. I want to know how to use PHP to connect to specific databases and the usernames/passwords assigned to the databases.
I’m looking through WordPress’s wp-config file, and I notice it shows a specific database, and the database’s username and password. When I go through WordPress’s install, it never asks for my root information. I’m going through a tutorial about MySQL and PHP and it only shows me how to connect with my root username and password.