Connecting to Databases
Connecting to a database is by far the easiest thing to do; however, we need to keep a few things in mind. In order to connect to any database, we need at least four things to be in place. We need a host to connect to, we need a database to connect to that is running on a port, and we need a username and password. The user needs to have appropriate privileges because we not only want to connect but we would like to perform specific operations, such as query, insert, or remove data, create or delete databases, and manage users and views. Let's imagine that connecting to a database is like walking up to a door as a specific person with a specific key. Whether the door opens or not depends on the key, but what we can do after we have crossed the threshold will depend on the person (which is defined by their privileges).
In most cases, the database server supports multiple databases and the databases hold one or more tables. Imagine that the databases are...